Skip to main content
5 of 15
added analogous examples
Jonathan Komar
  • 7.1k
  • 8
  • 38
  • 54

Is there a designated place for scripts that are (indirectly) automatically executed by systemd?

Arch Linux Question

I recently asked where to but a systemd unit file: Where do I put my systemd unit file?

I would like to run a python script every 5 minutes (not to be confused with a systemd unit file script that calls the python script). I read the answers to this question: Run script every 30 min with systemd

If I am running a script with a user who has higher privileges, this would be a security concern. For example, let's say I have a python script that is called automatically by a daemon, a user with malintentions could possibly edit the python script to cause damage to important files, or gather information that is not for his or her eyes. It is therefore relevant what users and groups may execute this script, therefore also where this script is placed.

This is where my question comes in. Where should or could you store scripts that are run by a user with higher privileges (let's say root user, just to find an extra-safe place)?

  • For example, logs are placed in /var/log
  • systemd unit files are placed under /etc/systemd/system
Jonathan Komar
  • 7.1k
  • 8
  • 38
  • 54