-1

I am using Arch Linux, I want to add a start-up program in Arch Linux. How to add start-up program which will execute after login after every boot ?

Note: I am not system administrator, I am just a user and I don’t have any special privileges.

Anthon
  • 78,313
  • 42
  • 165
  • 222
Ankith
  • 29
  • 1
  • 4

1 Answers1

1

If you have Vixie cron installed, you can add a @reboot entry in your crontab file:

Instead of the first five fields, one  of  eight  special  strings  may
appear:

       string         meaning
       ------         -------
       @reboot        Run once, at startup.

There you can take some action (i.e. writing some unique file) that you can check for during logging in (and remove that unique file) and execute your functionality once, after each reboot. On the second login (without a reboot) that unique file will not be available.

Anthon
  • 78,313
  • 42
  • 165
  • 222
  • This is unnecessarily convoluted (probably because the question is so vague); you would have been better off waiting for a clarification (or a close)... – jasonwryan Dec 06 '14 at 19:11
  • "after login"... AFAICT, cron doesn't wait for login. – muru Dec 06 '14 at 19:33
  • @jasonwryan I am not aware of anything simpler to do something once on login after reboot, but I agree the question is vague. Voted to close. – Anthon Dec 06 '14 at 19:34
  • 2
    @muru The cron part is to have a one time event that the user controls on each reboot. Something the login can check upon (so it knows it is not the second or later login after reboot). – Anthon Dec 06 '14 at 19:36
  • Thanks for your answer. Even after boot option is also acceptable. I haven't enough permissions to cron jobs. Please give me a simpler solution like editing .bash* files etc. Please provide me a solution. – Ankith Dec 07 '14 at 05:21
  • 2
    @Ankith rather that begging for a solution, how about answering the comments on your question and providing some helpful information about your setup? Don't be a [help vampire](http://slash7.com/2006/12/22/vampires/)... – jasonwryan Dec 07 '14 at 07:17
  • @Ankith you don't normally need special permissions to run cron. Do you have Vixie cron installed (`man crontab` should give an indication? Can you confirm that you only want to run something one time after each reboot, at the point where you login. – Anthon Dec 07 '14 at 07:17