Project

General

Profile

Actions

Regression #13025

closed

Some services won't start - wrong syntax in autogenerated rc.d scripts

Added by johnny stecchino over 2 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Viktor Gurov
Category:
Services
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
22.05
Release Notes:
Force Exclusion
Affected Version:
2.7.0
Affected Architecture:

Description

22.05-DEVELOPMENT (amd64)
built on Sun Apr 03 06:21:55 UTC 2022
FreeBSD 12.3-STABLE

noticed avahi and other services did not start. Tried to start service manually but got a /usr/local/etc/rc.d/avahi-daemon.sh: 17: Syntax error: "}" unexpected

The autogenerated file content is

#!/bin/sh
# This file was automatically generated
# by the Netgate pfSense Plus service handler.

rc_start() {
                /usr/local/sbin/avahi-daemon -D
}

rc_stop() {
                /usr/bin/killall -q avahi-daemon
}

rc_restart() {
                rc_stop()
        rc_start()

}

case $1 in
        start)
                rc_start
                ;;
        stop)
                rc_stop
                ;;
        restart)
                rc_restart
                ;;
esac

The syntax error is in function rc_restart() where calls to rc_stop and rc_start are followed by ()

the correct rc_restart should be:

rc_restart() {
         rc_stop
        rc_start
}

There.d service control script file is generated by /etc/inc/service-utils.inc

the correct /etc/inc/service-utils.inc should be:

diff service-utils.inc service-utils-new.inc
72,73c72,73
<         $torestart = "\trc_stop()\n";
<         $torestart .= "\trc_start()\n";
---
>         $torestart = "\trc_stop\n";
>         $torestart .= "\trc_start\n";


Files

service-utils-new.inc (25.2 KB) service-utils-new.inc revised file johnny stecchino, 04/03/2022 04:34 PM
service-utils.inc (25.2 KB) service-utils.inc original file johnny stecchino, 04/03/2022 04:34 PM

Related issues

Related to Bug #13004: ``write_rcfile()`` does not create ``rc_restart()`` entryResolvedViktor Gurov

Actions
Actions #1

Updated by Viktor Gurov over 2 years ago

  • Tracker changed from Bug to Regression
  • Project changed from pfSense Plus to pfSense
  • Category changed from Services to Services
  • Assignee set to Viktor Gurov
  • Target version set to 2.7.0
  • Plus Target Version set to 22.05
  • Affected Version set to 2.7.0
Actions #2

Updated by Viktor Gurov over 2 years ago

  • Related to Bug #13004: ``write_rcfile()`` does not create ``rc_restart()`` entry added
Actions #3

Updated by Viktor Gurov over 2 years ago

  • Release Notes changed from Default to Force Exclusion
Actions #4

Updated by Jim Pingle over 2 years ago

  • Status changed from New to Pull Request Review
Actions #5

Updated by Viktor Gurov over 2 years ago

  • Status changed from Pull Request Review to Feedback
Actions #6

Updated by Jim Pingle over 2 years ago

  • Status changed from Feedback to Resolved

Works now

Actions

Also available in: Atom PDF