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

rhel init script uses sudo - cannot be run without a tty #99

Open
acobaugh opened this issue Jan 8, 2016 · 3 comments
Open

rhel init script uses sudo - cannot be run without a tty #99

acobaugh opened this issue Jan 8, 2016 · 3 comments

Comments

@acobaugh
Copy link

acobaugh commented Jan 8, 2016

Using a config management tool like puppet, cfengine, etc doesn't work when using the provided init script:

sudo: sorry, you must have a tty to run sudo

I suggest using the daemon function provided by /etc/init.d/functions instead, as it will handle redirecting stdout as well.

@shawn-sterling
Copy link
Owner

Hello,

I would argue that you could use puppet/cfengine/etc to manager your sudoers and allow a tty for the particular user that was running it; but using a daemon function is likely a better solution.

Did you want to make a patch?

Have a good day.

-Shawn

@acobaugh
Copy link
Author

acobaugh commented Jan 8, 2016

Having to configure sudoers to allow root to sudo without a tty seems a bit icky. I'll provide an updated init script soon if nobody else gets to it sooner.

@acobaugh
Copy link
Author

The first problem I've found using the daemon() function is graphios.py isn't actually a daemon. Not being familiar enough with python, I don't know how much work would be involved to make this happen.

In the short term, I'm going to pursue a command like this:

nohup su ${GRAPHIOS_USER} -s /bin/sh -c "${prog} ${OPTIONS}" >/dev/null 2>&1 &

acobaugh added a commit to acobaugh/graphios that referenced this issue Jan 13, 2016
- Source /etc/sysconfig/graphios, if it exists
- Support an $OPTIONS variable to pass additional options to the program
- Use nohup+su to start and fork graphios.py instead of relying on sudo which requires a tty in its default configuration - should
 fix Issue shawn-sterling#99
- Start the program via /usr/bin/graphios.py, not /usr/bin/graphios. Fixes Issue
 shawn-sterling#100
- Other cleanup, including text formatting, spaces, etc
justino pushed a commit to justino/graphios that referenced this issue Jun 26, 2020
- Source /etc/sysconfig/graphios, if it exists
- Support an $OPTIONS variable to pass additional options to the program
- Use nohup+su to start and fork graphios.py instead of relying on sudo which requires a tty in its default configuration - should
 fix Issue shawn-sterling#99
- Start the program via /usr/bin/graphios.py, not /usr/bin/graphios. Fixes Issue
 shawn-sterling#100
- Other cleanup, including text formatting, spaces, etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants