I need one process run before log in to system. how to run it like services?(how do I make services in Linux?)
in Ubuntu and Fedora ? the service is customized tomcat
I need one process run before log in to system. how to run it like services?(how do I make services in Linux?) in Ubuntu and Fedora ? the service is customized tomcat |
|||||
|
To run a service without or before logging in to the system (i.e. "on boot"), you will need to create a startup script and add it to the boot sequence.
Once you have tweaked the script to your liking, just place it in /etc/init.d/
Service will be added to the system boot up process and you will not have to manually start it up again. Cheers! | |||||
|
Depending on init system, you create init script differently. Fedora gives you upstart and systemd to choose from, and of course SysV compatibility. Upstart
And you Tomcat should start on system start. Systemd
and enable your service using “systemctl enable custom-tomcat.service”. It will be started every normal boot. Of course there are few more configuration options for both init systems, you can check those in their documentation. | ||||
|
If you have a
| |||||||||||||||||
|
Tomcat is a fairly common service, I'd recommend looking at the init script provided by the distro already. Chances are it works with your customized binary, with little to no tweaking. | |||
|
For simply running a script after the computer started but before a user logs in, you can simply edit the script /etc/rc.local which is meant to solve exactly this task. | |||
|
In Ubuntu or Debian like you can use, to add
to remove
Bye! \o is nice to implements the functions status and force-reload to be LSB-compilant | |||||
|