Run script after SQM stops and starts

I would like to execute a custom shell script after SQM QoS stops and starts as shown below. I thought hotplug.d might do the trick but I'm not seeing a way of trapping a service stop or start. Any pointers would be appreciated.

Tue Jan 14 10:01:10 2025 user.notice SQM: Stopping SQM on eth0
Tue Jan 14 10:01:10 2025 user.notice SQM: Starting SQM script: piece_of_cake.qos on eth0, in: 490000 Kbps, out: 490000 Kbps
Tue Jan 14 10:01:10 2025 user.notice SQM: piece_of_cake.qos was started on eth0 successfully

add your pre and post to the service script ?

Thanks yeah I was thinking that but was also looking for other options if there were any.

Mmmh, so currently a qos script can specify its own start function, but we have not implemented that for stopping. What exactly are you looking to do?
For quick and dirty experimentation you could just modify the sqm_stop() function in sqm's /usr/lib/sqm/functions.sh. If there is a need we can implement something like the sqm_start_default logic, so custom sqm_stop() functions can be included to individual qos-scripts.

I want to reset the affinity settings on my R4S after SQM runs. SQM reloads every time I change pbr settings.

I edited the sqm init.d script to call it as frollic suggested. I was hoping I could make a hotplug.d script and leave the init.d script alone as I'm not sure if the sqm init.d script will get overwritten each upgrade or package update.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.