Copyright © 2008-2018, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.
Date: 2013nov27 OS: Linux Q. How do I make a systemd service? A. This worked for me. It might not be the perfect way. 1. Make a script that starts your sevice. Call it /usr/local/bin/MYSERVICE_start 2. Make a so-called unit file in /lib/systemd/system/MYSERVICE.service Put this stuff in it:[Unit] Description=Description of My Service After=network.target [Service] ExecStart=/usr/local/bin/MYSERVICE_start Type=simple [Install] WantedBy=multi-user.target3. Make symbolic linkcd /etc/systemd/system ln -s /lib/systemd/system/MYSERVICE.service MYSERVICE.service4. Make systemd take notice of itsystemctl daemon-reload5. Activate the service immediatelysystemctl start MYSERVICE6. Enable the service to be started on bootupsystemctl enable MYSERVICE
Add a commentSign in to add a comment