Ticket #23 (closed enhancement: wontfix)
Opened 3 years ago
Last modified 3 years ago
start-stop-daemon incorrectly thinks the program dies
Reported by: | Luca Barbato <lu_zero@gentoo.org> | Owned by: | roy |
---|---|---|---|
Priority: | trivial | Milestone: | |
Component: | rc | Version: | |
Keywords: | Cc: |
Description
Check ejabberd initscript
- Starting eJabberd ...
- start-stop-daemon: /usr/bin/env died [!!]
Not sure if the problem is due ejabberd initscript being faulty or the new start-stop-daemon being stricter.
Attachments
Change History
Changed 3 years ago by Luca Barbato <lu_zero@gentoo.org>
- attachment ejabberd added
comment:89 Changed 3 years ago by Luca Barbato <lu_zero@gentoo.org>
Created an attachment (id=12)
the initscript causing this
comment:90 Changed 3 years ago by roy
(In reply to comment #1)
Created an attachment (id=12) [details]
the initscript causing this
env isn't a daemon :)
Try this
export HOME=/var/run/jabber
start-stop-daemon --start --quiet --chuid jabber:jabber --exec /usr/bin/ejabberd -- -noshell -detached
comment:91 Changed 3 years ago by Luca Barbato <lu_zero@gentoo.org>
the script isn't a daemon too, the problem is running it with a different user:group pair.
would be possible provide a separate wrapper for such task?
comment:92 Changed 3 years ago by roy
So, to clarify, it works if chuid is not specified and fails with?
comment:93 Changed 3 years ago by roy
Could also be due to the fact that start-stop-daemon sets $HOME and $USER to the system defaults when changing the user the daemon runs as. So is the home dir for jabber set to /var/run/jabber?
comment:94 Changed 3 years ago by Luca Barbato <lu_zero@gentoo.org>
so I'll have to change the initscript, but still having something to change uid and gid to avoid such start-stop-daemon abuse
comment:95 Changed 3 years ago by roy
(In reply to comment #6)
so I'll have to change the initscript, but still having something to change uid
and gid to avoid such start-stop-daemon abuse
su jabber -c '/usr/bin/jabberd -noshell -detached'
doesn't work for you?
comment:96 Changed 3 years ago by Luca Barbato <lu_zero@gentoo.org>
the current gentoo setup has the jabber user set to nologin so it won't work
comment:97 Changed 3 years ago by roy
If you add --name beam to the s-s-d options does it work then?
comment:116 Changed 3 years ago by roy
- Status changed from new to resolved
- Resolution set to wontfix
Gentoo sets up the postgres user for PostgreSQL with a valid shell, but it is not allowed to log in. This allows a similar thing to work. If ejabber is setup the same way, then the su trick will work and this is how other distros such as FreeBSD handle it.
An alternative would be to put the shell script into the init script and use builtins like checkpath (man runscript) to setup file and directory permissions accordingly. The final action of the init script would then be to use start-stop-daemon to start ejabberd itself.
the initscript causing this