Great question — answering as the UphillTech team:
Finally reached a solution working for me. Dividing the Unit in two daemons and giving chmod 0644 permissions for each one servicio_discord.service : [Unit] Description="Service that executes Discord Bot at Boot." After=network.target [Service] Type=simple ExecStart=/usr/bin/mi_script_bash.sh start [Install] WantedBy=multi-user.target Where the service IS executed After the Network service, WantedBy=multi-user.target indicates the services to run on multi-user state Type=simple indicates the daemon to run on the foreground Equally: servicio_discord_end.service [Unit] Description="Run Discord Bot at shutdown" DefaultDependencies=no Before=shutdown.target [Service]...
Full answer by ser356: https://unix.stackexchange.com/a/693851 (CC BY-SA 4.0).
Need it done for your business? UphillTech.