-5

I am using Arch Linux. I don't have any special permissions, I am just user without any special privileges. I want to start an application after each boot.

I have already tried using crontab jobs, using @reboot . But it's not working.

How to run application at every system boot, (solutions for execution after login is even better).

Additional information: I have tried adding same cron job (using @reboot) job in Ubuntu also, but its also not working.

My crontab job:

@reboot /home/username/get_stats.py

Command should execute after first login after each reboot.

Anthon
  • 78,313
  • 42
  • 165
  • 222
ankith p
  • 101
  • 1
  • It's not working.... what is not working, why don't you show us your @reboot line by editing your question. Login can happen any number of times after reboot. Do you want something to happen on first login after reboot only, on every login? – Anthon Jan 03 '15 at 09:19
  • Why are you down voting my question Mr. Anthon van der Neut ????????????? – ankith p Jan 03 '15 at 09:30
  • If you hover above the down arrow, you can see the reasons for downvoting. Why do you think I am downvoting this? (And if I could only do that once). – Anthon Jan 03 '15 at 09:32
  • Is your get_stats.py executable? (output of `ls -l /home/username/get_stats.py`) – Anthon Jan 03 '15 at 09:33
  • Yes, it is executable. -rwxr-xr-x – ankith p Jan 03 '15 at 09:35
  • @reboot only works on Vixie cron IIRC. Do you have that installed? (`man cron` should be able to tell you). If you do have the `@reboot` only touch a file, then check in `get_stats.py` if the file exists -> exit if not, delete if it does and continue with the rest of script. – Anthon Jan 03 '15 at 09:40
  • Note: I have also added command pidgin. i.e. @reboot /usr/bin/pidgin. That is also not working. – ankith p Jan 03 '15 at 09:43
  • Are there any other methods to start an application at reboot or at login ? – ankith p Jan 03 '15 at 09:44
  • to start application after login, you might wish to edit .bash_profile (in command line). windows manager allow application to be launch upon windows manager run. – Archemar Jan 03 '15 at 09:47
  • I have already tried editing .bash_profile in text editor, How to edit .bash_profile in command line ? Is it possible without any special privileges ? How to run application using windows manager ? – ankith p Jan 03 '15 at 09:58

1 Answers1

0

You can add a line to your .bashrc file, so that it will be executed after restart and first login:
echo "python /home/username/myscript.py" >> ~/.bashrc

vkozyrev
  • 101
  • 5