Getting rails to execute root level file edits on system files without compromising security.
Posted
by
voxobscuro
on Stack Overflow
See other posts from Stack Overflow
or by voxobscuro
Published on 2011-01-04T00:38:03Z
Indexed on
2011/01/04
0:53 UTC
Read the original article
Hit count: 121
linux
|ruby-on-rails3
I'm writing a Rails 3 application that needs to be able to trigger modifications to unix system config files. I'd like to insulate the file modifications from the consumer side by running them in a background process. I've considered writing out a temp file in rails and then copying the file with a bash script but that doesn't really insulate the system. I've also considered pulling from the database manually with a cron based script and updating the configs.
But what I would really like is a component that can hook into the rails environment, read out what is needed from the database, and update the config files. This process needs to be run as root because the config files mostly live in /etc/whatever.
Any suggestions?
Thanks!
© Stack Overflow or respective owner