Ticket ID #132 ‐ Introduction to Systemd and Lab 2.1 Tasks - GriffinKat/group-a GitHub Wiki
Turn bash scripts into systemd service files
- Create a shell script in your home directory
- Make the file executable
- When executing the file I found it was taking too long so I changed the sleep to 5
Here you can see it is running
- Create a service file for the hello.sh script
- Copy this le to /etc/systemd/system
- Start the new service with the command
systemctl start hello.service
- Check that it is running with the command
systemctl status hello.service
- Stop the service from running with the command
systemctl stop hello.service
- Verify that it has stopped with the command
systemctl status hello.service