In the UPS service you have the option of putting a custom shutdown command, however the tool tip says there is a defautl shutdown command, does anyone know what this command is?
When battery power is low or the shutdown timer ends, enter the custom command to overrule the default shutdown command.
Thanks
MikeO3
August 19, 2024, 5:57pm
2
I have /sbin/poweroff (same as /sbin/shutdown - h now) as the command.
https://man.freebsd.org/cgi/man.cgi?shutdown(8)
You can also use the driver route with:
/usr/local/sbin/upsdrvctl shutdown
https://man.freebsd.org/cgi/man.cgi?query=upsdrvctl&sektion=8&manpath=freebsd-ports
@MikeO3 thanks for the info, but do you know what the current/default shutdown command is?
MikeO3
August 19, 2024, 8:47pm
4
Default is blank no action for every system I have installed. Admin decides on the action to be taken. For my use case, poweroff works.
It is blank, but a shutdown command is issued, so the tooltip says. This field just says you add your own custom one.
Is the tooltip wrong and there is no default shutdown command?
Also interested in this. Are you on scale by any chance? My tooltip says something else and im on CORE.
I am using SCALE.
Can you post a screen shot of the CORE tooltip please.
the default shutdown command in SCALE is:
/sbin/shutdown -P now
and can be found in the code here:
<%
import re
from middlewared.plugins.ups import UPS_POWERDOWN_FLAG_FILE
ups_config = middleware.call_sync('ups.config')
user = re.sub(r'([#$])', r'\\\1', ups_config['monuser'])
for field in filter(
lambda f: not ups_config[f],
['monpwd', 'identifier', 'mode', 'monuser']
):
middleware.logger.debug(f'UPSMON: {field} field empty, upsmon will fail to start.')
ident = ups_config['complete_identifier']
xseries = (middleware.call_sync('truenas.get_chassis_hardware')).startswith('TRUENAS-X')
if not ups_config['shutdowncmd'] and not xseries:
shutdown_cmd = '/sbin/shutdown -P now'
else:
shutdown_cmd = ups_config['shutdowncmd'] or ''
%>\
MONITOR ${ident} 1 ${user} ${ups_config['monpwd']} ${ups_config['mode']}
NOTIFYCMD ${"/usr/sbin/upssched"}
This file has been truncated. show original