2
I have a Ruby script which takes quite a while to run (5-20 seconds in most cases) and its purpose is to generate configuration files for Conky and Fluxbox.
At the moment I have the Ruby script set to run during the Fluxbox startup via adding it to the ~/.fluxbox/startup
file, but this causes a delay in Fluxbox starting since the config files has to be written before I can allow Fluxbox to start.
The way I usually use my laptop is to login to the terminal shell (bash
) only running startx
to get a graphical environment when I need it. In doing so I was looking for a way to have my script run at login in the background, but only run once. This means for any further shells spawned it will not run my script. Furthermore I need this to run only for a specific user when they log in.
What are my options? My script allows for editing of specific users config files so I can probably run my script at boot via the root user somehow (Ex: An init script set at the default run level... If I can get Ruby to work with init without stalling the init sequence like it does fluxbox, or maybe rc.local?). Otherwise is there a way to make the script run once, only at the initial login for a specific user?
Any help would be appreciated.
I was thinking the same, but will this halt the init process once it enters
runlevel 3
for the length of the script, or can call my script in the background via&
. I am basically looking for a way to run it in the background only once either on system boot, or user login. – user613083 – 2016-07-03T18:54:24.673+1 Your approach is different than mine, yet I think it is useful. Either one has its own advantages. – Kamil Maciorowski – 2016-07-03T20:08:58.747