rc.resume does not fire

I want to put resume logic in rc.resume.
I put logger statements in rc.suspend and I see those messages in /var/log/messages
I put logger statements all over rc.resume and none fire
If I invoke rc.resume as root (and pass "acpi 3" -- mapping to the undo to my acpiconf -s3 behavior on lid close), the scrips runs and the expected logging fires.
So i can only conclude that my rc.resume is not being fired on lid open.

Can anyone provide a hint about where to debug that (failed) binding? rc.suspend(8) didn't have any particulars. I think the binding might be in the sysctl mapping. But if anyone can correct my model before i start futzing with system files, I'd much appreciate it.
 
I put logger statements all over rc.resume and none fire
Works for me. Opening the laptop lid records a custom logger(1) entry.

Code:
% uname -a
FreeBSD ***** 15.0-RELEASE-p9 FreeBSD 15.0-RELEASE-p9 releng/15.0-n281048-6d536196f1bd GENERIC amd64

/etc/rc.resume
Rich (BB code):
     65 for _rc_elem in $files; do
     66         debug "run_rc_script $_rc_elem resume"
     67         run_rc_script $_rc_elem resume
     68 done
     69 logger Resumed from suspend
     70 exit 0

/var/log/messages
Code:
May 24 18:21:20 ***** root[73390]: Resumed from suspend

Code:
%  sysctl  hw.acpi.supported_sleep_state
hw.acpi.supported_sleep_state: S3 S4 S5

/etc/sysctl.conf
Code:
hw.acpi.lid_switch_state=S3

How does those logger(1) statements you put in /etc/rc.resume look like?
 
Hi T-Daemon. Nice to speak again.

Diff:
--- /usr/src/libexec/rc/rc.resume       2025-06-11 19:33:53.790334000 -0400
+++ /etc/rc.resume      2026-05-24 23:09:37.748542000 -0400

@@ -25,6 +25,7 @@

 # SUCH DAMAGE.

 #

 #

+/usr/bin/logger -t TRACER: C

 

 # sample run command file for APM Resume Event

 

@@ -52,6 +53,7 @@

 . /etc/rc.subr

 

 load_rc_config
+/usr/bin/logger Razzmatazz!
+/usr/bin/logger Performing network card restart per BUG 263632
+/usr/sbin/service netif start wlan0

It flat-out seems like rc.resume doesn't run.

Code:
May 25 23:16:14 homebsd acpi[39185]: suspend at 20260525 23:16:14
May 25 23:16:35 homebsd kernel: uhub1: at usbus1, port 1, addr 1 (disconnected)
May 25 23:16:35 homebsd kernel: ugen1.2: <vendor 0x06cb product 0x00bd> at usbus1 (disconnected)
May 25 23:16:35 homebsd kernel: ugen1.3: <Azurewave Integrated Camera> at usbus1 (disconnected)
May 25 23:16:35 homebsd kernel: ugen1.4: <vendor 0x8087 product 0x0026> at usbus1 (disconnected)
May 25 23:16:35 homebsd kernel: uhub1: detached
May 25 23:16:35 homebsd kernel: uhub0: at usbus0, port 1, addr 1 (disconnected)
May 25 23:16:35 homebsd kernel: uhub0: detached
May 25 23:16:35 homebsd kernel: vgapci0: child drmn0 requested pci_set_powerstate
May 25 23:16:35 homebsd kernel: acpi0: cleared fixed power button status
May 25 23:16:35 homebsd kernel: vgapci0: child drmn0 requested pci_set_powerstate
May 25 23:16:35 homebsd kernel: vgapci0: child drmn0 requested pci_enable_io
May 25 23:16:35 homebsd syslogd: last message repeated 1 times
May 25 23:16:35 homebsd kernel: uhub0 on usbus1
May 25 23:16:35 homebsd kernel: uhub0: <Intel XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus1
May 25 23:16:35 homebsd kernel: uhub1 on usbus0
May 25 23:16:35 homebsd kernel: uhub1: <Intel XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0
May 25 23:16:35 homebsd kernel: uhub1: 5 ports with 5 removable, self powered
May 25 23:16:35 homebsd kernel: uhub0: 16 ports with 16 removable, self powered
May 25 23:16:35 homebsd kernel: ugen1.2: <vendor 0x06cb product 0x00bd> at usbus1
May 25 23:16:35 homebsd workspace-resume[39270]: System resumed - checking for Workspace
May 25 23:16:35 homebsd kernel: ugen1.3: <Azurewave Integrated Camera> at usbus1
May 25 23:16:36 homebsd kernel: ugen1.4: <vendor 0x8087 product 0x0026> at usbus1
May 25 23:16:37 homebsd workspace-resume[39304]: No X session found, not restarting Workspace
May 25 23:25:20 homebsd swaylock[43394]: in _pam_exec(): pam_sm_setcred: pam_get_authtok(): authentication token not available
May 25 23:32:19 homebsd kernel: lo0: link state changed to DOWN
May 25 23:32:19 homebsd kernel: wlan0: Ethernet address: f0:57:a6:05:5d:57
May 25 23:32:19 homebsd syslogd: last message repeated 1 times
May 25 23:32:19 homebsd kernel: lo0: link state changed to UP

Auxiliary details:

$ uname -a
FreeBSD homebsd 15.0-RELEASE-p8 FreeBSD 15.0-RELEASE-p8 GENERIC amd64
$ sysctl hw.acpi.supported_sleep_state
hw.acpi.supported_sleep_state: S3 S4 S5

The really weird thing is rc.resume not seeming to fire at all. You see anything I missed?
 
Hi T-Daemon. Nice to speak again.
Same here.

It flat-out seems like rc.resume doesn't run.
Have you checked if /etc/rc.resume is executable?
Code:
% ls -l /etc/rc.resume
-rwxr-xr-x  1 root wheel 2407 May 26 10:25 /etc/rc.resume

In my test setup the custom entries are logged:

/etc/rc.resume
Code:
     28 /usr/bin/logger  -t TRACER: C

     58 /usr/bin/logger  Razzmatazz!
     59 /usr/bin/logger  Performing network card restart per BUG 263632
     60 #/usr/sbin/service netif start wlan0

/var/log/messages
Rich (BB code):
May 26 10:27:17 ***** TRACER:[61651]: C
May 26 10:27:17 ***** acpi[61656]: resumed at 20260526 10:27:17
May 26 10:27:17 ***** root[61679]: Razzmatazz!
May 26 10:27:17 ***** root[61683]: Performing network card restart per BUG 263632



Appropos logger(1) -t option in /usr/bin/logger -t TRACER: C, it's missing the specified tag in the entry:
Rich (BB code):
     -t tag  Mark every line in the log with the specified tag rather than the
             default of current login name.  Use -t tag[N] to insert specific
             decimal process id instead of id of logger.

See example in original /etc/rc.resume
Rich (BB code):
     31 if [ $# -ne 2 ]; then
     32         echo "Usage: $0 [apm|acpi] [standby,suspend|1-4]"
     33         exit 1
     34 fi
     35
     36 subsystem=$1
     37 state=$2

     49 /usr/bin/logger -t $subsystem resumed at `/bin/date +'%Y%m%d %H:%M:%S'`

/var/log/messages
Rich (BB code):
May 26 11:27:17 ***** acpi[61656]: resumed at 20260526 10:27:17

Custom "tag[N]" example /etc/rc.resume:
Rich (BB code):
     28 /usr/bin/logger  -t tag99 TRACER: C

/var/log/messages
Rich (BB code):
May 26 10:32:08 ***** tag99[63172]: TRACER: C
 
1. Confirmed +x
2. Can execute the script by invoking it `/etc/rc.resume` -- so syntax should be good
3. Noted on the misuse of `logger -t`.

Is this a possible hardware thing? The video card doesn't fire the wake-up hook? I'm on the i915kms.
 
Is this a possible hardware thing? The video card doesn't fire the wake-up hook? I'm on the i915kms.
I can't tell. "amdgpu" on my laptop.

See if a vanilla rc.resume, without customization, is executed ( /usr/src/libexec/rc/rc.resume copy perhaps).

When executed after resume, there should be a logger message. Example:
Code:
May 26 10:27:17 ***** acpi[61656]: resumed at 20260526 10:27:17

The log recording is triggered from /etc/rc.resume, line
Code:
49 /usr/bin/logger -t $subsystem resumed at `/bin/date +'%Y%m%d %H:%M:%S'`
 
Back
Top