#1148: shebang should be '/usr/bin/env ruby'
-------------------------+--------------------------------------------------
Reporter: do | Owner: luke
Type: defect | Status: new
Priority: normal | Milestone:
Component: executables | Version:
Severity: trivial | Resolution:
Keywords: | Stage: Ready for checkin
Patch: None | Complexity: Trivial
-------------------------+--------------------------------------------------
Comment (by jtimberman):
Replying to [comment:10 jamtur01]:
> Okay - discovered a flaw with this idea - I knew I had seen an issue.
Using the env ruby as the shebang breaks init scripts.
>
> * Tue Aug 1 2006 David Lutterkort <[EMAIL PROTECTED]> - 0.18.4-2
> - Use /usr/bin/ruby directly instead of /usr/bin/env ruby in
> executables. Otherwise, initscripts break since pidof can't find the
> right process
>
> Thoughts on how to address this?
Use pgrep instead of pidof in the Red Hat initscripts. The shebang
shouldn't be modified just because one platform's initscripts use a
nonportable method to determine what processes may be running. That said,
I would expect the initscripts written for a sysv implementation (ie, Red
Hat) to readily work on any sysv platform for portability and code reuse
reasons.
{{{
$ ps awux | grep puppet
puppet 5327 2.7 1.8 91076 77032 ? Ssl 02:00 20:29
/usr/bin/ruby /usr/sbin/puppetmasterd
--manifest=/var/lib/puppet/master/manifests/site.pp
--logdest=/var/log/puppet/
502 13578 0.0 0.0 3896 660 pts/1 S+ 14:25 0:00 grep
puppet
root 31219 0.4 1.1 62640 48408 ? Ss Mar30 25:58
/usr/bin/ruby /usr/sbin/puppetd --logdest=syslog
$ sudo pidof ruby
31219 5327
$ pgrep puppetmasterd
5327
$ pgrep puppetd
31219
}}}
If the system doesn't have pgrep, use ps and awk.
{{{
$ ps awux | awk '/bin\/puppetmaster/ {print $2}'
5327
$ ps awux | awk '/bin\/puppetd/ {print $2}'
31219
}}}
Or similar.
--
Ticket URL: <http://reductivelabs.com/trac/puppet/ticket/1148#comment:14>
puppet <http://reductivelabs.com>
Puppet - Portable System Automation
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---