Skip to contentSkip to conversation

policycoreutils: mcstransd: write a pid file FIXME

PATCH In review Daniel J Walsh 2 participants 5 messages Mar 27, 2012 – Mar 28, 2012 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 41/73 policycoreutils: mcstransd: write a pid file FIXME

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This patch looks good to me. acked.

systemd expects a pid file to be written by unit services. -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9x4YEACgkQrlYvE4MpobPLGwCgverG61aQYgrYV3P5BCISw+QO ZP4An3ahmMsngAp0CxVDDbIirCGdLdzY
=wQig
-----END PGP SIGNATURE-----

#1 lore raw
Quoted 3 lines · Daniel J Walsh

This patch looks good to me. acked.

systemd expects a pid file to be written by unit services.

It doesn't if the service is non-forking. In fact moving to non-forking services that don't write pid files is a major improvement that systemd brings over sysvinit, because the state is 100% reliable. Pid files create the possibility of desynchronization if the service crashes, but the pid file remains.

So a better fix would be to change mcstransd to have a --no-fork option, and update the unit file to use it.

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#2 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 5 lines · Colin Walters
Quoted 3 lines · Daniel J Walsh

This patch looks good to me. acked.

systemd expects a pid file to be written by unit services.

Quoted 7 lines

It doesn't if the service is non-forking. In fact moving to non-forking services that don't write pid files is a major improvement that systemd brings over sysvinit, because the state is 100% reliable. Pid files create the possibility of desynchronization if the service crashes, but the pid file remains.

So a better fix would be to change mcstransd to have a --no-fork option, and update the unit file to use it.

-- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

How about. this patch.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9yAMYACgkQrlYvE4MpobNgMwCgxJ0rYn5VJyybfV5OeuYNIrCU CbUAnA5BoNnWx2/JXS5IzHgbfrn/IDJb
=FH0Q
-----END PGP SIGNATURE-----

#3 lore raw

The naming here is confusing...the C variable should be called "daemonize" or "do_fork" or something.

+ if (foreground && daemon(0, 0)) {

Would then be:

if (!foreground && daemon(0, 0))

Right?

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#4 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 11 lines · Colin Walters

The naming here is confusing...the C variable should be called "daemonize" or "do_fork" or something.

+ if (foreground && daemon(0, 0)) {

Would then be:

if (!foreground && daemon(0, 0))

Right?

Ok using do_fork.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9zSQIACgkQrlYvE4MpobNJeQCeMJJLClSc7KgtNxtEp9SRRgrm gscAoJGil/oYdK+agV3OSDF/eUm8nixW
=0jm0
-----END PGP SIGNATURE-----

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.