Shall sockets are owned by rpm or created/removed by post/preun scriptlet?

Tom Hughes tom at compton.nu
Tue May 21 08:02:04 UTC 2013


On 21/05/13 08:51, Björn Esser wrote:

> In maintainer's `generic-all-purpose-and-all-rpm-dists` spec-file there
> is this scriptlet inside %install for creating/providing the needed
> socket:
>
> /scriptlet/
>
>      mkdir -p %{buildroot}%{_localstatedir}/spool/authdaemon/
>      ./authmksock %{buildroot}%{_localstatedir}/spool/authdaemon/socket
>      touch %{buildroot}%{_localstatedir}/spool/authdaemon/pid.lock
>      touch %{buildroot}%{_localstatedir}/spool/authdaemon/pid
>      chmod 0777 %{buildroot}%{_localstatedir}/spool/authdaemon/socket
>
> /endscriptlet/
>
> My question about this is:
> Can I take this one-by-one in my fedora-rpm or is it better to provide
> the same functionality during %post and %preun?

Well surely sockets and PID files shouldn't be in /var/spool anyway, 
they should be in /var/run (aka /run)...

On top of which I wouldn't expect them to be pre-created anyway - the 
daemon would normally create them on startup, or have them created by 
systemd when the daemon is started.

Anything which does need to be pre-created would have to be done using 
tmpfiles.d once the files are in /run.

Tom

-- 
Tom Hughes (tom at compton.nu)
http://compton.nu/


More information about the devel mailing list