All of lore.kernel.org
 help / color / mirror / Atom feed
* OE systemd RemainAfterExit does not work
@ 2021-09-15  8:16 JH
  2021-09-15  8:40 ` [OE-core] " Chen Qi
  0 siblings, 1 reply; 5+ messages in thread
From: JH @ 2021-09-15  8:16 UTC (permalink / raw)
  To: Yocto discussion list; +Cc: OE

Hi,

I am running a logout systemd service to clean up in shutdown, the
service was called in boot but was not called in the shutdown process,
I double checked the mlogout.sh script which was not executed.

I tried RemainAfterExit=yes, it did not work either, what could I be missing?

# cat /lib/systemd/system/mlogout.service

[Unit]
Description=Logout clean job
After=syslog.target
DefaultDependencies=no

[Service]
Type=oneshot
ExecStop=/usr/bin/mlogout.sh
RemainAfterExit=true
# RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Thank you.

Kind regards,

- jupiter

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] OE systemd RemainAfterExit does not work
  2021-09-15  8:40 ` [OE-core] " Chen Qi
@ 2021-09-15  8:32   ` JH
  2021-09-15  8:55     ` Chen Qi
  0 siblings, 1 reply; 5+ messages in thread
From: JH @ 2021-09-15  8:32 UTC (permalink / raw)
  To: Chen Qi; +Cc: Patches and discussions about the oe-core layer

> How about adding 'ExecStart=/bin/true' here?

It was my first try, but it did not work so I removed it.

Thank you Qi.

Kind regards,

- jupiter

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] OE systemd RemainAfterExit does not work
  2021-09-15  8:16 OE systemd RemainAfterExit does not work JH
@ 2021-09-15  8:40 ` Chen Qi
  2021-09-15  8:32   ` JH
  0 siblings, 1 reply; 5+ messages in thread
From: Chen Qi @ 2021-09-15  8:40 UTC (permalink / raw)
  To: openembedded-core

[-- Attachment #1: Type: text/plain, Size: 770 bytes --]

On 09/15/2021 04:16 PM, JH wrote:
> Hi,
>
> I am running a logout systemd service to clean up in shutdown, the
> service was called in boot but was not called in the shutdown process,
> I double checked the mlogout.sh script which was not executed.
>
> I tried RemainAfterExit=yes, it did not work either, what could I be missing?
>
> # cat /lib/systemd/system/mlogout.service
>
> [Unit]
> Description=Logout clean job
> After=syslog.target
> DefaultDependencies=no
>
> [Service]
> Type=oneshot
How about adding 'ExecStart=/bin/true' here?

Regards,
Qi
> ExecStop=/usr/bin/mlogout.sh
> RemainAfterExit=true
> # RemainAfterExit=yes
>
> [Install]
> WantedBy=multi-user.target
>
> Thank you.
>
> Kind regards,
>
> - jupiter
>
>
> 
>


[-- Attachment #2: Type: text/html, Size: 1390 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] OE systemd RemainAfterExit does not work
  2021-09-15  8:32   ` JH
@ 2021-09-15  8:55     ` Chen Qi
  2021-09-15  9:59       ` JH
  0 siblings, 1 reply; 5+ messages in thread
From: Chen Qi @ 2021-09-15  8:55 UTC (permalink / raw)
  To: Jupiter; +Cc: Patches and discussions about the oe-core layer

On 09/15/2021 04:32 PM, Jupiter wrote:
>> How about adding 'ExecStart=/bin/true' here?
> It was my first try, but it did not work so I removed it.
>
> Thank you Qi.
>
> Kind regards,
>
> - jupiter
>
Adding 'Conflicts=shutdown.target' seems to work. I just did a quick test.

Regards,

Qi


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [OE-core] OE systemd RemainAfterExit does not work
  2021-09-15  8:55     ` Chen Qi
@ 2021-09-15  9:59       ` JH
  0 siblings, 0 replies; 5+ messages in thread
From: JH @ 2021-09-15  9:59 UTC (permalink / raw)
  To: ChenQi; +Cc: Patches and discussions about the oe-core layer

Hi Qi,

Indeed that did the trick, you rock!

Thank you so much.

Kind regards,

- jupiter


On 9/15/21, ChenQi <Qi.Chen@windriver.com> wrote:
> On 09/15/2021 04:32 PM, Jupiter wrote:
>>> How about adding 'ExecStart=/bin/true' here?
>> It was my first try, but it did not work so I removed it.
>>
>> Thank you Qi.
>>
>> Kind regards,
>>
>> - jupiter
>>
> Adding 'Conflicts=shutdown.target' seems to work. I just did a quick test.
>
> Regards,
>
> Qi
>
>


--
"A man can fail many times, but he isn't a failure until he begins to
blame somebody else."
-- John Burroughs

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-09-15 10:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-15  8:16 OE systemd RemainAfterExit does not work JH
2021-09-15  8:40 ` [OE-core] " Chen Qi
2021-09-15  8:32   ` JH
2021-09-15  8:55     ` Chen Qi
2021-09-15  9:59       ` JH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.