Giter VIP home page Giter VIP logo

Comments (8)

VBart avatar VBart commented on June 27, 2024 1

Igor suggested --prefix=/opt/unit --state=state and that configures /opt/unit/state path as the internal state storage for unit daemon.

In this case, the /opt/unit/state directory need to be created and be writable by the main process.

from unit.

VBart avatar VBart commented on June 27, 2024 1

If you compile unit with the --debug option, you will see more information about what's wrong.

from unit.

igorsysoev avatar igorsysoev commented on June 27, 2024

What is in unit.log ?

from unit.

VBart avatar VBart commented on June 27, 2024

More detailed errors in case of invalid configuration will be ready soon.

As of now, since your configuration on my system applies without a problem, there are only two possibilities: there's no nginx user with nginx group on your system or the php module is not found in the configured modules directory.

from unit.

VBart avatar VBart commented on June 27, 2024

Well, in your case, it's very likely that the configuration is invalid because of wrong path to the modules directory. As I see from #43, you have unit modules path: "build" configured, but the php module was installed into /opt/unitbuild/ using DESTDIR.

from unit.

centminmod avatar centminmod commented on June 27, 2024

thanks, the unit log confirms module path error

tail -100 /var/log/unitd.log 
2017/09/23 06:55:47 [info] 3054#3054 discovery started
2017/09/23 06:55:47 [notice] 3054#3054 no modules matching: "build/*.unit.so" found
2017/09/23 06:55:47 [info] 3055#3055 controller started
2017/09/23 06:55:47 [notice] 3053#3053 process 3054 exited with code 0
2017/09/23 06:55:47 [crit] 3055#3055 epoll_ctl(3, 3, 9) failed (2: No such file or directory)
2017/09/23 06:55:47 [info] 3056#3056 router started
2017/09/23 06:55:47 [crit] 3056#3056 epoll_ctl(3, 3, 9) failed (2: No such file or directory)
2017/09/23 06:58:20 [notice] 3053#3053 process 3055 exited with code 0
2017/09/23 06:58:20 [notice] 3053#3053 process 3056 exited with code 0
2017/09/23 07:00:58 [info] 3292#3292 discovery started
2017/09/23 07:00:58 [notice] 3292#3292 no modules matching: "build/*.unit.so" found
2017/09/23 07:00:58 [info] 3293#3293 controller started
2017/09/23 07:00:58 [notice] 3291#3291 process 3292 exited with code 0
2017/09/23 07:00:58 [info] 3294#3294 router started
2017/09/23 07:00:58 [crit] 3293#3293 epoll_ctl(3, 3, 9) failed (2: No such file or directory)
2017/09/23 07:00:58 [crit] 3294#3294 epoll_ctl(3, 3, 9) failed (2: No such file or directory)
2017/09/23 07:24:24 [notice] 3291#3291 process 3293 exited with code 0
2017/09/23 07:24:24 [notice] 3291#3291 process 3294 exited with code 0

from unit.

centminmod avatar centminmod commented on June 27, 2024

thanks with fixed Unit configure setup it's working now

curl -X PUT -d @/root/tools/unitconfigs/phpstart.json --unix-socket /opt/unit/control.unit.sock http://localhost/
curl -X PUT -d @/root/tools/unitconfigs/phpstart.json --unix-socket /opt/unit/control.unit.sock http://localhost/
{
        "success": "Reconfiguration done."
}
curl --unix-socket /opt/unit/control.unit.sock http://localhost/
{
        "listeners": {
                "*:8300": {
                        "application": "php56domaincom"
                }
        },

        "applications": {
                "php56domaincom": {
                        "type": "php",
                        "workers": 10,
                        "root": "/home/nginx/domains/domain.com/public",
                        "user": "nginx",
                        "group": "nginx",
                        "index": "index.php"
                }
        }
}

though I get failed to store current configuration

systemctl status unitd                                                                                           
● unitd.service - NGINX Unit
   Loaded: loaded (/usr/lib/systemd/system/unitd.service; disabled; vendor preset: disabled)
   Active: active (running) since Sat 2017-09-23 10:19:52 UTC; 15s ago
  Process: 10467 ExecStart=/opt/unit/sbin/unitd (code=exited, status=0/SUCCESS)
 Main PID: 10468 (unitd)
   CGroup: /system.slice/unitd.service
           ├─10468 unit: main [/opt/unit/sbin/unitd]
           ├─10470 unit: controller
           └─10471 unit: router

Sep 23 10:19:52 centos7.localdomain systemd[1]: Starting NGINX Unit...
Sep 23 10:19:52 centos7.localdomain unitd[10467]: 2017/09/23 10:19:52 [info] 10467#10467 unit started
Sep 23 10:19:52 centos7.localdomain systemd[1]: Started NGINX Unit.
Sep 23 10:20:06 centos7.localdomain t/unit/sbin/unitd][10468]: [alert] 10468#10468 failed to store current configuration
tail -20 /var/log/unitd.log   
2017/09/23 10:14:40 [info] 10403#10403 discovery started
2017/09/23 10:14:40 [notice] 10403#10403 module: php 5.6.31 "/opt/unit/modules/php5631.unit.so"
2017/09/23 10:14:40 [notice] 10403#10403 module: python 2.7.5 "/opt/unit/modules/python.unit.so"
2017/09/23 10:14:40 [info] 10404#10404 controller started
2017/09/23 10:14:40 [info] 10405#10405 router started
2017/09/23 10:14:40 [crit] 10404#10404 epoll_ctl(3, 3, 9) failed (2: No such file or directory)
2017/09/23 10:14:40 [crit] 10405#10405 epoll_ctl(3, 3, 9) failed (2: No such file or directory)
2017/09/23 10:14:40 [notice] 10402#10402 process 10403 exited with code 0
2017/09/23 10:16:18 [alert] 10402#10402 failed to store current configuration
2017/09/23 10:19:52 [notice] 10402#10402 process 10404 exited with code 0
2017/09/23 10:19:52 [notice] 10402#10402 process 10405 exited with code 0
2017/09/23 10:19:52 [info] 10469#10469 discovery started
2017/09/23 10:19:52 [notice] 10469#10469 module: php 5.6.31 "/opt/unit/modules/php5631.unit.so"
2017/09/23 10:19:52 [notice] 10469#10469 module: python 2.7.5 "/opt/unit/modules/python.unit.so"
2017/09/23 10:19:52 [info] 10470#10470 controller started
2017/09/23 10:19:52 [info] 10471#10471 router started
2017/09/23 10:19:52 [crit] 10470#10470 epoll_ctl(3, 3, 9) failed (2: No such file or directory)
2017/09/23 10:19:52 [crit] 10471#10471 epoll_ctl(3, 3, 9) failed (2: No such file or directory)
2017/09/23 10:19:52 [notice] 10468#10468 process 10469 exited with code 0
2017/09/23 10:20:06 [alert] 10468#10468 failed to store current configuration

looks like /opt/unit/state directory wasn't created.. manually creating seems to fix it

ls -lah state/
total 4.0K
drwxr-xr-x 2 root root  22 Sep 23 10:28 .
drwxr-xr-x 6 root root  78 Sep 23 10:28 ..
-rw------- 1 root root 217 Sep 23 10:28 conf.json
cat state/conf.json 
{"listeners":{"*:8300":{"application":"php56domaincom"}},"applications":{"php56domaincom":{"type":"php","workers":10,"root":"/home/nginx/domains/domain.com/public","user":"nginx","group":"nginx","index":"index.php"}}}

from unit.

centminmod avatar centminmod commented on June 27, 2024

thanks @VBart for clarification :)

from unit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.