Skip to content

Permission denied on log files without sudo #12

Description

@ovidiubuligan

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 )

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions