[systemd-devel] Inhibit locks via unit file

Orion Poplawski orion at nwra.com
Tue Apr 9 20:26:22 UTC 2024


On 4/9/24 14:05, SCOTT FIELDS wrote:
> What are you trying to accomplish?
> 
> From within a service unit file, doesn't sound like you really mean an
> "inhibit lock" action

Currently I have:

# cat /etc/systemd/system/nwra-update.service
[Unit]
Description=NWRA Update
After=network-online.target

[Service]
Type=oneshot
Nice=19
IOSchedulingClass=2
IOSchedulingPriority=7
Environment="ABRT_IGNORE_PYTHON=1"
ExecStart=/bin/systemd-inhibit "--why=NWRA update in progress" --what=shutdown
--mode=block /usr/local/sbin/nwra-update
ExecStartPost=/usr/local/sbin/needs-restart
ExecStartPost=/usr/local/sbin/reboot-if-needed

So was thinking that something like:

InhibitWhat=shutdown
InhibitWhy=NWRA update in progress
InhibitMode=block

to set the inhibit lock while the service was running might be useful.  Though
since I may want to reboot in the ExecStartPost perhaps that isn't what I want.



> ------------------------------------------------------------------------------
> *From:* systemd-devel on behalf of Orion Poplawski
> *Sent:* Tuesday, April 9, 2024 2:46 PM
> *To:* Systemd
> *Subject:* [EXTERNAL] [systemd-devel] Inhibit locks via unit file
> 
> Is there a way for a service unit to take out inhibit locks via settings in
> the unit file?  My searches are coming up empty...
> 
> Thanks.
> 
> --
> Orion Poplawski
> he/him/his  - surely the least important thing about me
> Manager of IT Systems                      720-772-5637
> NWRA, Boulder/CoRA Office             FAX: 303-415-9702
> 3380 Mitchell Lane                       orion at nwra.com
> Boulder, CO 80301                 https://www.nwra.com/ <https://www.nwra.com/>

-- 
Orion Poplawski
he/him/his  - surely the least important thing about me
Manager of IT Systems                      720-772-5637
NWRA, Boulder/CoRA Office             FAX: 303-415-9702
3380 Mitchell Lane                       orion at nwra.com
Boulder, CO 80301                 https://www.nwra.com/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3826 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20240409/76c4a9fb/attachment-0001.bin>


More information about the systemd-devel mailing list