LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Need help running scripts as a user and with permissions (https://www.linuxquestions.org/questions/linux-newbie-8/need-help-running-scripts-as-a-user-and-with-permissions-4175554634/)

jim.thornton 09-27-2015 08:22 AM

Need help running scripts as a user and with permissions
 
I've installed an app that runs as a Daemon and continually monitors directories and manipulates file names. The problem is that when it is creating new files it is creating them with the ownership root which is then inaccessible to my other users. I then created a chmod and chown command to change the permissions on the directories/files. The problem is that this seems extremely inefficient to me. It also breaks the automation of the app which then requires me to manually click on the changes.

I created a special no-login user for this app.
I installed the app into that new user's profile (using root because it was a no-login user)
I created an init.d script so that it runs on reboot (using root because it was a no-login user)

The script is always running, but I'm assuming because I put it in the init.d of root that is why it is running as root.

I need help with the following:
1. How can I setup an init.d script to run as the user I installed to?
2. How can I setup my permissions so that my normal user "myname" can access those files that are created?

ButterflyMelissa 09-27-2015 08:27 AM

Quote:

How can I setup an init.d script to run as the user I installed to?
Not at all, that is a system script, needs (AFAIK) to be run as root...
Quote:

How can I setup my permissions so that my normal user "myname" can access those files that are created?
add the user to the group that is allowed to do that...

chrism01 09-27-2015 09:33 PM

The first answer here https://serverfault.com/questions/35...-nologin-shell seems to work.
If you want to start it from init.d I guess you'd make it
Code:

nohup <cmds> &


All times are GMT -5. The time now is 03:57 AM.