dneto Posted December 7, 2015 Report Share Posted December 7, 2015 Hi Friends, Sorry for this n00b question. I already read the OpenRC documentation but I'm not able to make works well. In fact develop and scripting isn't my passion. I have this script to CentOS systems: [Unit] Description=Blacklist monitor [Service] Type=simple User=root Group=root ExecStart=/usr/bin/php /var/www/localhost/htdocs/blacklistmonitor/service/blacklistmonitor.php >>/var/log/blacklistmonitor.log 2>&1 # Give a reasonable amount of time for the server to start up/shut down TimeoutSec=300 # how to setup for centos # cp /var/www/html/blacklistmonitor/setup/blacklistmonitor-centos-systemd.conf /etc/systemd/system/blacklistmonitor.service # systemctl restart blacklistmonitor.service # systemctl stop blacklistmonitor.service # systemctl start blacklistmonitor.service Can anyone help me to make an OpenRC script? Regards Link to comment Share on other sites More sharing options...
skunk Posted December 8, 2015 Report Share Posted December 8, 2015 following these instruction would result something like this: #!/sbin/runscript SERVICE="/usr/bin/php /var/www/localhost/htdocs/blacklistmonitor/service/blacklistmonitor.php" start() { ebegin "Starting my service" start-stop-daemon --start --background --exec $SERVICE --pidfile /run/blacklistmonitor.pid >> /var/log/blacklistmonitor.log 2>&1 eend $? } stop() { start-stop-daemon --stop --exec $SERVICE --pidfile /run/blacklistmonitor.pid } Link to comment Share on other sites More sharing options...
dneto Posted December 16, 2015 Author Report Share Posted December 16, 2015 HI @skunk, Thanks for you answer. I tried you script and write a new one. But when I check status, i get "crashed". How do I debug the init start? Link to comment Share on other sites More sharing options...
skunk Posted December 16, 2015 Report Share Posted December 16, 2015 just remove "--pidfile /run/blacklistmonitor.pid"... dneto 1 Link to comment Share on other sites More sharing options...
dneto Posted December 17, 2015 Author Report Share Posted December 17, 2015 Hi Skunk, Thank you. Works without --pidfile Link to comment Share on other sites More sharing options...
Recommended Posts