Ubuntu: creating an init.d service

#create then put your script (e.g. nginx) into /etc/init.d with root as user & group
sudo update-rc.d nginx defaults		-> loads the script
sudo update-rc.d nginx enable		-> enable the script to run at system sturtup/boot
service nginx start					-> starts the service
service nginx status
systemctl -l status nginx
service --status-all				-> shows status for all services
systemctl							-> shows all active units
systemctl list-units --type=service	-> shows all active services (--all to see loaded but inactive services too)

# reload service's configuration:
sudo systemctl reload nginx.service

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.