[CentOS] systemd service configuration

Mon Oct 13 00:50:10 UTC 2014
Alan Stern <stern at rowland.harvard.edu>

On Sun, 12 Oct 2014, James Hogarth wrote:

> On 12 Oct 2014 05:20, "Igal @ getRailo.org" <igal at getrailo.org> wrote:
> >
> > does adding a /lib/systemd/system/{unit}.service all I need in order to
> > add a service?
> >
> 
> Yes but for service files that have not been introduced through package
> management (ie rpm) the proper location is /etc/systemd/system
> 
> Note that any files in /etc/systemd will override ones in /usr/lib/systemd
> 
> >
> > are any special permissions required for that file (execute)?
> 
> No these are just configuration files rather than scripts that get executed
> so no special permissions are needed.
> 
> After adding or changing a unit file do systemctl daemon-reload for systemd
> to read in the changes.

You also have to enable the service with "systemctl enable <name>".  
And if you want it to start right away, instead of waiting for the next 
reboot, you have to start it with "systemctl start <name>".

Alan Stern