Re: Inhibit locks via unit file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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]  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@xxxxxxxx
> 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@xxxxxxxx
Boulder, CO 80301                 https://www.nwra.com/

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux