Writing a systemd script that starts 2 applications in linux
Proponents of systemd will tell you that systemd is easier because you don't need to write scripts.
For systemd, you will probably need two services, one for app1
and one for app2
. Create the files in /etc/systemd/system
, for example app1.service
with:
[Unit]
Description=app1 systemd service.
[Service]
Type=simple
ExecStart=/path/of/your/app/app1
[Install]
WantedBy=multi-user.target
To enable at boot time do
systemctl enable app1.service