Actions
Regression #13025
closedSome services won't start - wrong syntax in autogenerated rc.d scripts
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
Related issues
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
Updated by Viktor Gurov over 2 years ago
- Related to Bug #13004: ``write_rcfile()`` does not create ``rc_restart()`` entry added
Updated by Viktor Gurov over 2 years ago
- Release Notes changed from Default to Force Exclusion
Updated by Jim Pingle over 2 years ago
- Status changed from New to Pull Request Review
Updated by Viktor Gurov over 2 years ago
- Status changed from Pull Request Review to Feedback
Actions