Bug 257586 - [devd] dies shortly after being restarted by [service] within a pkg-install script
Summary: [devd] dies shortly after being restarted by [service] within a pkg-install s...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 12.2-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-08-03 13:12 UTC by Bertrand Petit
Modified: 2021-09-05 16:58 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bertrand Petit 2021-08-03 13:12:50 UTC
Note: I'm unsure where to file this bug report, either in base or ports.

On a 12.2-STABLE host (rev 8b9b3d90de5dbeba0f8d68a154c657c0c139e5a9) I experience troubles when running service(8) to restart devd(8) within a pkg-install or pkg-deinstall script: devd is stopped but it fails to properly restart.

My pkg-install script is as shown bellow, the deinstall is almost identical apart from s/POST-INSTALL/POST-DEINSTALL/:

#!/bin/sh                                                                       
SERVICE=/usr/sbin/service
if [ "$2" = POST-INSTALL ] ; then
    ${SERVICE} devd restart
    ${SERVICE} devd status
fi

When installing I observe that devd does not last long:

# service devd status ; /usr/bin/make install ; echo postmake ; service devd status
devd is running as pid 13426.
===>  Installing for uartdevconf-1.0
===>  Checking if uartdevconf is already installed
===>   Registering installation for uartdevconf-1.0
Installing uartdevconf-1.0...
Stopping devd.
Waiting for PIDS: 13426.
Starting devd.
devd is running as pid 13514.
postmake
devd is not running.

When starting (or restarting) devd after installation, from outside of the package installation environment, it lasts:

# service devd status ; /usr/bin/make install ; echo postmake ; service devd status ; service devd start ; sleep 2 ; service devd status
devd is running as pid 13983.
===>  Installing for uartdevconf-1.0
===>  Checking if uartdevconf is already installed
===>   Registering installation for uartdevconf-1.0
Installing uartdevconf-1.0...
Stopping devd.
Waiting for PIDS: 13983.
Starting devd.
devd is running as pid 14077.
postmake
devd is not running.
Starting devd.
devd is running as pid 14114.

That is a showstopper because this port/package relies on a set of devd rules for correct operation.