Bug 169047 - [rc.subr] [patch] /etc/rc.subr not checking some scripts (e.g. ruby running 'thin')
Summary: [rc.subr] [patch] /etc/rc.subr not checking some scripts (e.g. ruby running '...
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: Hiroki Sato
URL:
Keywords: patch-ready
Depends on:
Blocks:
 
Reported: 2012-06-14 04:30 UTC by Tassilo Philipp
Modified: 2018-05-23 10:28 UTC (History)
5 users (show)

See Also:


Attachments
file.diff (626 bytes, patch)
2012-06-14 04:30 UTC, Tassilo Philipp
no flags Details | Diff
etc-rc.subr.patch.txt (598 bytes, patch)
2014-03-11 11:09 UTC, geoff
no flags Details | Diff
deduplicate the procnamebn variable by moving it outside the if-then-else block (763 bytes, patch)
2017-05-18 12:04 UTC, Ralf van der Enden
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tassilo Philipp 2012-06-14 04:30:05 UTC
I wrote a rc.d script to handle 'thin' processes on startup, however I couldn't stop it using "/etc/rc.d/thin stop". Check /etc/rc.subr, I noticed that "find_processes" looks for something in the ps output like:

5570      0 ruby19: /usr/local/bin/thin server (0.0.0.0:80) (ruby19)

whereas in my case, it is:

5570      0 ruby19: thin server (0.0.0.0:80) (ruby19)

Find attached a patch that would fix the problem.

For reference, here is my /etc/rc.d/thin:
---------------->
#!/bin/sh
#

# PROVIDE: thin
# REQUIRE: DAEMON
# BEFORE: LOGIN

. /etc/rc.subr

# Defaults.
thin_enable=${thin_enable:-"NO"}

name=thin
rcvar=thin_enable
app_path=/var/www/grecLeFroc

command="/usr/local/bin/${name}"
command_args="start -d -c ${app_path}/current -p 80 -e production"
command_interpreter="/usr/local/bin/ruby19"

pidfile="${app_path}/shared/pids/${name}.pid"

# Crucial (!) for execjs to find js runtime.
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin

load_rc_config $name
run_rc_command "$1"
<----------------
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2012-06-17 23:35:47 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-rc

Over to maintainer(s).
Comment 2 geoff 2014-03-11 11:04:22 UTC
Any idea when this might get included, its not in FreeBSD 10-RELEASE.
Comment 3 geoff 2014-03-11 11:09:44 UTC
Heres an updated copy of the patch if that helps.
Comment 4 John Marino freebsd_committer 2014-07-28 12:52:10 UTC
it does help.
Comment 5 John Marino freebsd_committer 2014-07-28 12:54:35 UTC
sorry, I thought this was a port.  I just realized it's a base PR.
Comment 6 Hiroki Sato freebsd_committer 2014-11-03 23:47:45 UTC
Take.
Comment 7 Ralf van der Enden 2017-05-18 12:04:15 UTC
Created attachment 182691 [details]
deduplicate the procnamebn variable by moving it outside the if-then-else block

I have the exact same issue with several Python programs running in the background. My patch moves the original declaration of procnamebn outside the if-then-else block to avoid duplication.

Any chance this will be merged with HEAD in the very near future ? (I'm asking since this PR is quite old)
Comment 8 Eitan Adler freebsd_committer freebsd_triage 2018-05-23 10:28:02 UTC
batch change of PRs untouched in 2018 marked "in progress" back to open.