tags 856568 moreinfo
thanks

Hi,

On Thu, Mar 02, 2017 at 04:04:33PM +0100, Teun wrote:
> After adding the option: "-P /var/run/memcached.pid" to '/etc/memcached.conf',
> I get the following error:
> 
> systemd-memcached-wrapper[2577]: Could not open the pid file
> /var/run/memcached.pid.tmp for writing: Permission denied
> 

Is there any reason to have a pid file for a systemd managed service ?
Systemd handle well the crash of the process in case of crash:

# pkill -9 memcached 
# service memcached status
● memcached.service - memcached daemon
   Loaded: loaded (/lib/systemd/system/memcached.service; enabled)
   Active: failed (Result: signal) since Tue 2017-03-21 23:12:47 GMT; 2s ago
  Process: 4204 
ExecStart=/usr/share/memcached/scripts/systemd-memcached-wrapper 
/etc/memcached.conf (code=killed, signal=KILL)
 Main PID: 4204 (code=killed, signal=KILL)

Mar 21 23:11:46 jessie systemd[1]: Started memcached daemon.
Mar 21 23:12:47 jessie systemd[1]: memcached.service: main process exited, 
code=killed, status=9/KILL
Mar 21 23:12:47 jessie systemd[1]: Unit memcached.service entered failed state.

As systemd official doc says [1][2], it is recommended to use PIDFile if the 
service forks and exit at startup. Systemd wrapper script does not exit after 
startup and can run in foreground.


[1]: https://www.freedesktop.org/software/systemd/man/systemd.service.html#Type=
[2]: 
https://www.freedesktop.org/software/systemd/man/systemd.service.html#PIDFile=

-- 
Guillaume Delacour

Attachment: signature.asc
Description: Digital signature

Reply via email to