unbit / uwsgi-docs

Official uWSGI docs, examples, tutorials, tips and tricks
MIT License
639 stars 346 forks source link

Systemd.rst inline comment in emperor config not ignored when directories are created #289

Closed kylegibson closed 8 years ago

kylegibson commented 8 years ago

I followed the documentation as instructed here: https://github.com/unbit/uwsgi-docs/blob/master/Systemd.rst#adding-the-emperor-to-systemd

Particularly, I created a emperor.uwsgi.service file with the following contents:

[Unit]
Description=uWSGI Emperor
After=syslog.target

[Service]
ExecStart=/root/uwsgi/uwsgi --ini /etc/uwsgi/emperor.ini
RuntimeDirectory=uwsgi # Requires systemd version 211 or newer
Restart=always
KillSignal=SIGQUIT
Type=notify
StandardError=syslog
NotifyAccess=all

[Install]
WantedBy=multi-user.target

Notice the RuntimeDirectory setting has an inline comment. Well, it doesn't appear that this is actually treated as an inline comment:

:~ $ ls -l /run/
total 28
drwxr-xr-x 2 root  root     40 Feb  7 00:49 #
drwxr-xr-x 2 root  root     40 Feb  7 00:49 211
drwxr-xr-x 2 avahi avahi    80 Feb  6 21:17 avahi-daemon
-rw-r--r-- 1 root  root      4 Feb  6 21:17 crond.pid
---------- 1 root  root      0 Feb  6 21:17 crond.reboot
drwxr-xr-x 2 root  root     60 Feb  6 21:17 dbus
lrwxrwxrwx 1 root  root     25 Feb  6 21:17 initctl -> /run/systemd/initctl/fifo
drwxrwxrwt 4 root  root    100 Feb  6 21:17 lock
drwxr-xr-x 3 root  root     60 Feb  6 21:17 log
drwxr-xr-x 2 root  root     60 Feb  6 21:17 mount
drwxr-xr-x 2 mysql root     80 Feb  6 21:19 mysqld
drwxr-xr-x 2 root  netdev   80 Feb  6 21:17 network
drwxr-xr-x 2 root  root     40 Feb  7 00:49 newer
-rw-r--r-- 1 root  root      5 Feb  6 21:22 nginx.pid
-rw-r--r-- 1 root  root      3 Feb  6 21:17 ntpd.pid
drwxr-xr-x 2 root  root     40 Feb  7 00:49 or
drwxrwsr-x 2 redis redis    60 Feb  6 21:17 redis
drwxr-xr-x 2 root  root     40 Feb  7 00:49 Requires
-rw-r--r-- 1 root  root      4 Feb  6 21:17 rsyslogd.pid
drwxrwxr-x 3 root  utmp     60 Feb  7 00:13 screen
drwxr-xr-x 2 root  root     40 Feb  6 21:17 sendsigs.omit.d
lrwxrwxrwx 1 root  root      8 Feb  6 21:17 shm -> /dev/shm
drwxr-xr-x 2 root  root     40 Feb  6 21:17 sshd
-rw-r--r-- 1 root  root      4 Feb  6 21:17 sshd.pid
drwxr-xr-x 6 root  root    120 Feb  7 00:50 systemd
-rw-r--r-- 1 root  root      4 Feb  6 21:17 thd.pid
srwxr-xr-x 1 root  root      0 Feb  6 21:17 thd.socket
drwxr-xr-x 2 root  root     60 Dec 31  1969 tmpfiles.d
drwxr-xr-x 7 root  root    160 Feb  6 21:17 udev
drwxr-xr-x 2 root  root     40 Feb  6 21:17 user
-rw-rw-r-- 1 root  utmp   2688 Feb  7 00:44 utmp
drwxr-xr-x 2 root  root     40 Feb  7 00:49 uwsgi
drwxr-xr-x 2 root  root     40 Feb  7 00:49 version

Notice that there are a few odd directories: #, Requires, 211, or, newer.

kylegibson commented 8 years ago

Another consequence of this problem is that /run/systemd is clobbered, breaking the initctl symlink and rendering future systemctl calls busted.

xrmx commented 8 years ago

Thanks, fixed in 20ecd37ba06b6710dc28f291bca54d84175d9945. Next time please open a pull request since it would have been trivial to fix ;)

xrmx commented 8 years ago

Ah, you actually did it sorry. Then please just go straight to the pull request instead of comment then issue then pull request, since that's actual three notifications for me and if i act to the first i end up doing more work than needed. Thanks!