Daemon In /etc/init.d/functions Creates No Pifile?

Home » CentOS » Daemon In /etc/init.d/functions Creates No Pifile?
CentOS 4 Comments

Hi,

we started using CentOS7 to run kvm+libvirt. For novnc to virtual machines I like to start websockify as a daemon by libvirt (as a hook)

Under Debian I used the line:
# start-stop-daemon –start –chuid $RUNUSER –make-pidfile –pidfile $PIDFILE –startas $PROGRAM — $OPTIONS
which creates a nice pidfile.

In CentOS I figured out, to include /etc/init.d/functions and I tried:
# daemon –user $RUNUSER –pidfile=$PIDFILE $PROGRAM $OPTIONS

But this seems not to create a pidfile at all. It checks only if a pidile exist already. This is executed at the end
# $cgroup $nice runuser -s /bin/bash $user -c “$corelimit >/dev/null 2>&1 ; $*”

Am I missed something?

Thanks,

Sebastian

4 thoughts on - Daemon In /etc/init.d/functions Creates No Pifile?

  • OK, I figured out, I have to install redhat-lsb package for start-stop-daemon
    “Implementation of Linux Standard Base specification”

    Thanks,

    Sebastian

  • using systemd unit templates seems to be even a better idea, I’m using that now. Let systemd handle that stuff is more easy.

    # cat /etc/libvirt/hooks/qemu
    ————-

  • skotthof wrote:

    Sorry I missed the beginning of this thread. You are using (CentOS 6)
    service blablah start, or (CentOS 7) systemctl start blahblah, yes?

    mark

  • I’m using CentOS7 with systemd systemctl. I god a helpful tip from a college to use systemd unit templates, which works very nice.

    So everything is fine,

    Thanks,

    Sebastian