Bug 87972 - ports [mail/exilog] - fix for the exilog.sh rc script to make "status" and "restart" command work correctly
Summary: ports [mail/exilog] - fix for the exilog.sh rc script to make "status" and "r...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Vsevolod Stakhov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-25 09:10 UTC by Oleksii Samorukov
Modified: 2005-11-03 13:43 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (513 bytes, patch)
2005-10-25 09:10 UTC, Oleksii Samorukov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oleksii Samorukov freebsd_committer 2005-10-25 09:10:13 UTC

Now "status" and "restart" command will not work correctly in exilog.sh rc script. This is because of 2 reasons:
1) By default exilog daemon change process name, so rc.subr functions dont beleive that exilog process is a owner of the pidfile. This can be changed in the exilog.conf ('use_pretty_names' => 'no')
2) exilog_agent.pl is a perl script, so we need to add string command_interpreter=/usr/bin/perl.

Fix: # diff -u exilog.sh.ori exilog.sh 
How-To-Repeat: 

run 
# /usr/local/etc/rc.d/exilog.sh start
# /usr/local/etc/rc.d/exilog.sh status
you will get a message "exilog is not running"
Comment 1 Oleksii Samorukov freebsd_committer 2005-10-25 09:19:20 UTC
After this patch we dont need special action for the "stop" command, so 
here is a corrected diff:

--- exilog.sh.ori       Tue Oct 25 10:53:50 2005
+++ exilog.sh   Tue Oct 25 11:11:36 2005
@@ -5,6 +5,8 @@
 # Add the following lines to /etc/rc.conf to enable exilog agent:
 #
 #exilog_enable="YES"
+#
+# also uncomment  'use_pretty_names' => 'no' in exilog.conf file
 
 . %%RC_SUBR%%
 
@@ -14,17 +16,10 @@
 command=%%PREFIX%%/sbin/exilog_agent.pl
 pidfile=/var/run/exilog.pid
 required_files=%%PREFIX%%/etc/exilog.conf
+command_interpreter=/usr/bin/perl
 
 # read settings, set default values
 load_rc_config $name
 : ${exilog_enable="NO"}
 
-case $1 in
-       stop)
-               kill `cat $pidfile`
-               rm -f $pidfile
-       ;;
-       *)
-               run_rc_command "$1"
-       ;;
-esac
+run_rc_command "$1"
Comment 2 Sergey Matveychuk freebsd_committer 2005-10-25 09:45:52 UTC
Responsible Changed
From-To: freebsd-ports-bugs->vsevolod

Over to maintainer.
Comment 3 Vsevolod Stakhov freebsd_committer 2005-11-03 13:43:48 UTC
State Changed
From-To: open->closed

Committed, thanks!