pleaserun
pleaserun copied to clipboard
chroot --userspec not supported on RedHat/CentOS EL 5
RedHat/CentOS EL 5 ship with coreutils-5.97 which doesn't include the --userspec command line option. This causes the generated init scripts to not be usable on these systems.
(╯°□°)╯︵ ┻━┻
I'll take a look.
Something horrible like this works. There is runuser/daemon in the /etc/init.d/functions file but they don't really help with forking.
touch $pidfile
chown ${LS_USER} $pidfile
nice -n ${LS_NICE} su -s /bin/sh ${LS_USER} -c "
cd $LS_HOME
ulimit -n ${LS_OPEN_FILES}
\"$program\" $args < /dev/null > \"${LS_LOG_DIR}/$name.stdout\" 2> \"${LS_LOG_DIR}/$name.err\" &
echo \$! > $pidfile
disown \$!
"
I'm open to switching to su
but that has the same problems as chroot
by behaving differently across platforms.. hmm.
The 'su' and 'bin/sh' aren't being run interactively, so there shouldn't be any job control, right? Disown shouldn't be necessary, should it?
I think @deverton's approach works well enough. I'll try integrating it once I have the test suite working again (I seem to have broken all of my docker images somehow, so no tests run anymore)
Hi, How can I fix this issue with RedHat 5.6? I'm running few production instances?
Do you've work around solution?
I look forward to hear from you.
Many Thanks, Madhu
I've also just run foul of this issue, I've installed 0.4.0 rpm via spacewalk and none of my servers are sending logs. I get the chroot error in my log files... I attempted using an old init script I had from 0.3.1 which seemed to work with one machine, but I had no luck with a second... For now I have turned LSF off
Does anyone have a work around for this issue? Or just a working init script for CentOS 5.x would be nice
@Rumbles see the thread referenced above your post. ( https://github.com/elastic/logstash-forwarder/issues/425#issuecomment-107380293 ) I replaced the line as hrchu suggested in there and this works for me on centos5.6 with logstash 1.5.1
I'm sure logstash will soon mature beyond this.
As per the above related issue it may be that the line here can be edited
https://github.com/jordansissel/pleaserun/blob/master/templates/sysv/lsb-3.1/init.sh#L63
I'm not familiar enough with pleaserun to understand what further impact this may have further down the line.
thanks, Luke
@jordansissel If this is blocked on something specific give me a ping, I'd be glad to resolve blockers for you
I'm slow to incorporate changes into pleaserun lately because the test suite busted (I used to be able to verify all supported platforms quickly). Sorry about the delays.
If folks are happy with the su
patch proposal, I can try and test it manually on a few platforms and we can move forward with that.
Please see the above suggested solution. Not sure what else it will break.
@jordansissel - What needs to be done to fix the test suite?