Running a Ruby script once at Linux login

خرید بک لینک

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.

Recent Questions...

ما را در سایت Recent Questions دنبال می‌کنید

برچسب: نویسنده: استخدام کار بازدید: 303 تاريخ: دوشنبه 14 تير 1395 ساعت: 1:11

صفحه بندی