Systemd script not running python script with config.ini

Out of curiosity – I made a custom service with just ‘ls’ – to see what directory was the current one when starting a service with systemctl.

The output in the system journal leads me to believe it’s starting with “/” as the current directory. I executed ‘systemctl start test’ from /etc/systemd/system – not in “/”..

[Unit]
Description=aqi
After=multi-user.target

[Service]
Type=simple
ExecStart=/usr/bin/ls

[Install]
WantedBy=multi-user.target



Oct 30 13:11:40 oelinux2 ls[1951]: bin
Oct 30 13:11:40 oelinux2 ls[1951]: boot
Oct 30 13:11:40 oelinux2 ls[1951]: dev
Oct 30 13:11:40 oelinux2 ls[1951]: etc
Oct 30 13:11:40 oelinux2 ls[1951]: home
Oct 30 13:11:40 oelinux2 ls[1951]: lib
Oct 30 13:11:40 oelinux2 ls[1951]: lib64
Oct 30 13:11:40 oelinux2 ls[1951]: media
Oct 30 13:11:40 oelinux2 ls[1951]: mnt
Oct 30 13:11:40 oelinux2 ls[1951]: opt
Oct 30 13:11:40 oelinux2 ls[1951]: proc
Oct 30 13:11:40 oelinux2 ls[1951]: root
Oct 30 13:11:40 oelinux2 ls[1951]: run
Oct 30 13:11:40 oelinux2 ls[1951]: sbin
Oct 30 13:11:40 oelinux2 ls[1951]: srv
Oct 30 13:11:40 oelinux2 ls[1951]: sys
Oct 30 13:11:40 oelinux2 ls[1951]: tmp
Oct 30 13:11:40 oelinux2 ls[1951]: usr
Oct 30 13:11:40 oelinux2 ls[1951]: var

ls command on same machine from /

[[email protected] /]# ls
bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
[[email protected] /]#

My first thought.. is to change “./config” to the full path of where ‘config’ is located. Try that and see if it can find it.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top