user defined service help

"Jóhann B. Guðmundsson" johannbg at gmail.com
Wed May 4 19:51:23 UTC 2011


On 05/04/2011 03:50 PM, Brian Millett wrote:
> [Unit]
> Description=JBoss AS 7 domain server
> After=local-fs.target network.target
>
> [Service]
> Type=simple
> ExecStart=/opt/jboss/bin/domain.sh
> NonBlocking=yes
>
> [Install]
> WantedBy=multi-user.target
/usr/lib/systemd/user/jboss7.service <-- ? this path is a bit odd all 
custom files should reside in the /etc/systemd/system/ directory 
regardless of Linux distribution

Other than that it should work.

Reload the systemd daemon to let it pick up the changes

systemctl daemon-reload

To start the service

systemctl start jboss7.service

To stop the service

systemctl stop jboss7.service

To see the status of the service

systemctl status jboss7.service

To enable the service run

systemctl enable jboss7.service

systemd service files default to Type=simple so you could skip that line 
if you wanted to.

JBG


More information about the test mailing list