Modify

Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#10584 closed defect (fixed)

bug in syslog-ng init script

Reported by: olesz@… Owned by: developers
Priority: normal Milestone: Chaos Calmer 15.05
Component: packages Version: Backfire 10.03.1 RC6
Keywords: syslog-ng Cc:

Description

Hi,

The syslog-ng init script has bugs:

  • stop kills the init script before the syslog-ng process could be killed (killall syslog-ng) because the name of the script is also syslog-ng
  • start starts the syslog-ng multiple times

My proposed solution is:

#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=50
PIDFILE="/var/run/syslog-ng.pid"

start() {
  [ -f /etc/syslog-ng.conf ] || {
    echo "/etc/syslog-ng.conf does not exist !";
    exit 0;
  };
  [ -f $PIDFILE ] && {
    echo "syslog-ng is already running `cat $PIDFILE`!";
    exit 0;
  };
  [ -d /var/run ] || mkdir -p /var/run
  [ -x /usr/sbin/syslog-ng ] && /usr/sbin/syslog-ng --pidfile $PIDFILE
}

stop() {
  kill `cat $PIDFILE`
}

restart() {
        stop
        sleep 1
        start
}

reload() {
        kill -HUP `cat $PIDFILE` &>/dev/null
}

Attachments (0)

Change History (2)

comment:1 Changed 6 years ago by swalker

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in r30168.

comment:2 Changed 4 years ago by jow

  • Milestone changed from Backfire 10.03.2 to Chaos Calmer (trunk)

Milestone Backfire 10.03.2 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.