-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Permission denied on log files without sudo #12
Comments
this command solves permissions problem: |
Well, i already did that and it gives me |
I would say that you should change permissions on files that the init.d script is using and also the script permissions. First give read and write to /var/log/file and /var/run/file because you're writing pid/logs and and eventually reading them too. Then change permissions to the init.d script so ubuntu can execute it. Basically try to execute every command within the script with the ubuntu user first and then you can safely add all of them to the script. You're probably going to find a problem here, deleting the pidfile when stoping the service means you will have to create another one, that can simply be done with touch but you will have to add permissions and for that you need root privileges. Maybe creating a folder inside /var/run is a solution for that. |
I am writing my first autostartup init.d script with a fresh instance of ubuntu amazon EC2 and I can't run it without sudo .
ubuntu@ip-172-31-XX-XXX:~$ /etc/init.d/codebox start Starting codebox /etc/init.d/codebox: 44: /etc/init.d/codebox: nvm: not found /etc/init.d/codebox: 50: /etc/init.d/codebox: cannot create /var/run/codebox.pid: Permission denied /etc/init.d/codebox: 46: /etc/init.d/codebox: cannot create /var/log/codebox.log: Permission denied Unable to start, see /var/log/codebox.log and /var/log/codebox.err
If I run it with sudo it ill work but I don't konw how safe it is.
(Side question. If i edit the script and add just after
cd "$dir"
nvm use 0.12.7
nvm command is not found. Are there restrictions in what you can put inside an init.d script )The text was updated successfully, but these errors were encountered: