How to setup systemd file to start up bash scrip in clear linux?

yes, I tried to work the script normally and it is working. The problem has been solved, I needed to add the information to keep it running after exit, also gave it root permission and it somehow worked.

[Unit]
Description=Example systemd service.

[Service]
Type=simple
User=root
ExecStart=/bin/bash /usr/local/bin/my_file.sh
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

1 Like