Skip to content
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

Upstart script fails to create missing pid directory #47

Closed
brianbianco opened this issue Feb 27, 2013 · 3 comments
Closed

Upstart script fails to create missing pid directory #47

brianbianco opened this issue Feb 27, 2013 · 3 comments
Assignees

Comments

@brianbianco
Copy link
Contributor

setuid and setgid cause the ENTIRE upstart job to run as that user. Since the default user is "redis" this means that user cannot create the appropriate pid directory. The upstart script will have to be modified to call out to sudo to run the redis process itself, this is an issue however as I don't believe you can use sudo to set the ulimit as limit is a shell builtin.

This is a known limitation of upstart and a real pain in the butt :)

@ghost ghost assigned brianbianco Feb 27, 2013
@brianbianco
Copy link
Contributor Author

Oh, the joy i've felt working with upstart. The TL;DR is that when using upstart as a job control, i will have to tell redis not to daemonize itself, then i can run it via upstart. In order to allow the creation of the pid directory in the upstart script I can't use setuid as it is global to the script. That means I have to run the redis server binary like so

su -s /bin/sh -c exec "$0" "$@" redis /usr/local/bin/redis-server /etc/redis/6379.conf

As using sudo causes issues with upstart as it forks.

The bright side here is this actually seems to work, and work on reboot without any issue.

I also have started to depend on the "ulimit" cookbook to handle the setting of the file descriptor limit for redis. I had resisted this change in the past as I like keeping requirements thin, but i've buckled on this one.

@brianbianco
Copy link
Contributor Author

This is finally fixed. Is released as 1.4.1

@lock
Copy link

lock bot commented Nov 28, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant