0

I have a .py script which I want to run at startup.

I wrote this code in a file named test1.conf and kept in /etc/init

start on runlevel [2345]
stop on runlevel [!2345]

python /home/partho/Documents/py/test/x.py

The command in the 3rd line is a valid command (tested). This command is not running at startup, I am sure because a window should be shown by running the command, which I don't see.

What's going wrong?

2
  • 1
    By 'startup', do you mean before-user-login (boot) or after-user-login (session start)? Boot processes must run headless - displays are not available until after login. In either case, consider revising your script to use modern systemd targets instead of runlevels from two init generations ago.
    – user535733
    Jan 7, 2017 at 1:48
  • I meant after login. By the way, I solved in another way.
    – partho
    Jan 7, 2017 at 10:50

1 Answer 1

0

first of all you have to check that your conf file has any syntactical error or not by,typing cmd on terminal init-checkconf /etc/init/<yourfile>.conf if it show File /etc/init/<yourfile>.conf: syntax ok then there is no syntactical error. and writeexec python /home/partho/Documents/py/test/x.py instead only giving cmd and check it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .