Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #http://www.mehrdust.com/archives/managing-services-in-ubuntu
- #http://www.itmanage.info/technology/linux/ubuntu/enable%20disable%20service%20during%20start%20up%20in%20ubuntu.html
- ### Services start ###
- /etc/init.d/myservice start/stop/restart
- or,
- service myservice start/stop/restart
- ### Getting a list of Services ###
- ls /etc/init.d
- service --status-all
- ls -l /etc/rc?.d/*apache2
- Runlevel 0: Halt System – To shutdown the system
- Runlevel 1: Single user mode
- Runlevel 2: Basic multi user mode without NFS
- Runlevel 3: Full multi user mode (text based)
- Runlevel 4: unused
- Runlevel 5: Multi user mode with Graphical User Interface
- Runlevel 6: Reboot System
- ### Adding a Service to Default runlevels ###
- cp /etc/init.d/myscript.sh << copy your script to /etc/init.d
- chmod +x /etc/init.d/myscript.sh
- update-rc.d myscript.sh defaults
- update-rc.d apache2 defaults
- or,
- update-rc.d apache2 start 20 2 3 4 5 . stop 80 0 1 6 .
- ### Removing a Service from Default runlevels ###
- rm /etc/rc*/*myscript
- or,
- update-rc.d -f apache2 remove
Advertisement
Add Comment
Please, Sign In to add comment