0

here is the script in question:

description "Circuit server"
author      "anonymous"

start on filesystem or runlevel [2345]
stop on shutdown

# Script fails when setuid and setgid are not commented
setuid sentimens
setgid sentimens

script

    echo $$ > /var/run/circuit.pid
    exec /bin/circuit start --docker

end script

pre-start script
    echo "[`date`] Circuit Server Starting" >> /var/log/circuit.log
end script

pre-stop script
    rm /var/run/circuit.pid
    echo "[`date`] Circuit Server Stopping" >> /var/log/circuit.log
end script

With the addition of the setgid and setuid lines, I can no longer start my service:

$ sudo service circuit start
start: Job failed to start

$ init-checkconf /etc/init/circuit.conf 
File /etc/init/circuit.conf: syntax ok

I'm not sure where to go from here. What is the likely cause of this error given that init-checkconf seems happy?

Louis Thibault
  • 117
  • 2
  • 6
  • Check the obvious: permission problems. – Michael Hampton May 26 '16 at 20:03
  • @MichaelHampton, That is indeed the problem. The user can't write to `/var/run`, but I'm unsure of the security implications behind granting access to that directory. I guess that's fodder for another question, though. Thank you for your help! – Louis Thibault May 26 '16 at 20:08
  • 1
    Make a subdirectory in /var/run, have it owned by the correct user then write the PID there instead. –  May 26 '16 at 23:57

0 Answers0