Bug 224977 - irc/ircd-hybrid rc script prints error when stopping service
Summary: irc/ircd-hybrid rc script prints error when stopping service
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Diane Bruce
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-07 19:30 UTC by Robert Ames
Modified: 2018-01-14 15:18 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (db)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Ames 2018-01-07 19:30:18 UTC
When shutting down ircd-hybrid, a confusing error is displayed
stating the pid file does not exist:

# /usr/local/etc/rc.d/ircd-hybrid stop
Stopping ircd_hybrid.
Waiting for PIDS: 14504.
rm: /var/run/ircd/ircd.pid: No such file or directory

This is because after ircd correctly cleans up it's pid file, the
rc script tries to delete the non existing file.  In the rc script,
stop_postcmd is not needed.  Patch:

--- irc/ircd-hybrid/files/ircd-hybrid.in.orig   2017-09-28 19:21:57.000000000 -0500
+++ irc/ircd-hybrid/files/ircd-hybrid.in        2018-01-06 09:16:04.354386000 -0600
@@ -19,7 +19,6 @@
 command=/usr/local/bin/ircd
 
 start_precmd=pid_touch
-stop_postcmd=pid_rm
 
 load_rc_config ${name}
 
@@ -36,9 +35,4 @@
     chown $ircd_hybrid_user $pidfile
 }
 
-pid_rm ()
-{
-    rm $pidfile
-}
-
 run_rc_command "$1"


If stop_postcmd is needed for some reason I don't understand, then
the "rm" command should be "rm -f" so no error is displayed.
Comment 1 commit-hook freebsd_committer freebsd_triage 2018-01-10 19:28:46 UTC
A commit references this bug:

Author: db
Date: Wed Jan 10 19:28:05 UTC 2018
New revision: 458681
URL: https://svnweb.freebsd.org/changeset/ports/458681

Log:
  Update to 8.2.13 and fix as per robertames@hotmail.com  PR

  #######################################################################
  Reminder for package maintainers of ircd-hybrid: ircd-hybrid now has
  GnuTLS support as of version 8.2.13
  #######################################################################

  Bug report from robertames@hotmail.com

  When shutting down ircd-hybrid, a confusing error is displayed
  stating the pid file does not exist:

  # /usr/local/etc/rc.d/ircd-hybrid stop
  Stopping ircd_hybrid.
  Waiting for PIDS: 14504.
  rm: /var/run/ircd/ircd.pid: No such file or directory

  This is because after ircd correctly cleans up it's pid file, the
  rc script tries to delete the non existing file.  In the rc script,
  stop_postcmd is not needed.

  PR:		ports/224977
  Submitted by:	robertames@hotmail.com

Changes:
  head/irc/ircd-hybrid/Makefile
  head/irc/ircd-hybrid/distinfo
  head/irc/ircd-hybrid/files/ircd-hybrid.in