0

wondering how I can have a ruby script started at boot, as a particular user.

This is on centos, so I imagine i need to create a service. ?

thomasfedb
  • 415
  • 5
  • 14

3 Answers3

1

If you just want to run this script at boot time, put it in that user's crontab with the special time @reboot.

If the script is a long-running process that would normally keep running until you reboot, then a adding a service is the best solution.

0

Read /usr/share/doc/initscripts-*/sysvinitfiles for information on writing the initscript that you'll need for this.

Ignacio Vazquez-Abrams
  • 45,019
  • 5
  • 78
  • 84
0

Or u can add to /etc/rc.local somthing like this:

/usr/bin/sudo -u $user /path/to/script/script.rb