#2 add ownership of /run/{motd,motd.d} and /usr/lib/{motd,motd.d}
Opened 3 years ago by rfairley. Modified 3 months ago
rfairley/filesystem rfairley-motd-own  into  master

file modified
+15 -3
@@ -1,6 +1,6 @@ 

  Summary: The basic directory layout for a Linux system

  Name: filesystem

- Version: 3.9

+ Version: 3.10

  Release: 1%{?dist}

  License: Public Domain

  URL: https://pagure.io/filesystem
@@ -8,6 +8,8 @@ 

  Source1: https://pagure.io/filesystem/raw/master/f/lang-exceptions

  Source2: iso_639.sed

  Source3: iso_3166.sed

+ Source4: run.motd

+ Source5: usr-lib.motd

  BuildRequires: iso-codes

  Requires(pre): setup

  
@@ -42,10 +44,13 @@ 

  

  mkdir -p boot dev \

          etc/{X11/{applnk,fontpath.d,xinit/{xinitrc,xinput}.d},xdg/autostart,opt,pm/{config.d,power.d,sleep.d},xinetd.d,skel,sysconfig,pki,bash_completion.d,rwtab.d,statetab.d} \

-         home media mnt opt proc root run srv sys tmp \

-         usr/{bin,games,include,%{_lib}/{games,sse2,tls,X11,pm-utils/{module.d,power.d,sleep.d}},lib/{debug/{.dwz,usr},games,locale,modules,sysimage,sse2},libexec,local/{bin,etc,games,lib,%{_lib},sbin,src,share/{applications,man/man{1,2,3,4,5,6,7,8,9,n,1x,2x,3x,4x,5x,6x,7x,8x,9x},info},libexec,include,},sbin,share/{aclocal,appdata,applications,augeas/lenses,backgrounds,bash-completion{,/completions,/helpers},desktop-directories,dict,doc,empty,games,gnome,help,icons,idl,info,licenses,man/man{1,2,3,4,5,6,7,8,9,n,1x,2x,3x,4x,5x,6x,7x,8x,9x,0p,1p,3p},metainfo,mime-info,misc,omf,pixmaps,sounds,themes,xsessions,X11,wayland-sessions},src,src/kernels,src/debug} \

+         home media mnt opt proc root run/{motd.d,} srv sys tmp \

+         usr/{bin,games,include,%{_lib}/{games,sse2,tls,X11,pm-utils/{module.d,power.d,sleep.d}},lib/{debug/{.dwz,usr},games,locale,modules,motd.d,sysimage,sse2},libexec,local/{bin,etc,games,lib,%{_lib},sbin,src,share/{applications,man/man{1,2,3,4,5,6,7,8,9,n,1x,2x,3x,4x,5x,6x,7x,8x,9x},info},libexec,include,},sbin,share/{aclocal,appdata,applications,augeas/lenses,backgrounds,bash-completion{,/completions,/helpers},desktop-directories,dict,doc,empty,games,gnome,help,icons,idl,info,licenses,man/man{1,2,3,4,5,6,7,8,9,n,1x,2x,3x,4x,5x,6x,7x,8x,9x,0p,1p,3p},metainfo,mime-info,misc,omf,pixmaps,sounds,themes,xsessions,X11,wayland-sessions},src,src/kernels,src/debug} \

          var/{adm,empty,ftp,gopher,lib/{games,misc,rpm-state},local,log,nis,preserve,spool/{mail,lpd},tmp,db,cache,opt,games,yp}

  

+ install -p -c -m644 %SOURCE4 %{buildroot}/run/motd

+ install -p -c -m644 %SOURCE5 %{buildroot}/usr/lib/motd

+ 

  #do not create the symlink atm.

  #ln -snf etc/sysconfig etc/default

  ln -snf ../var/tmp usr/tmp
@@ -204,6 +209,8 @@ 

  %attr(555,root,root) /proc

  %attr(550,root,root) /root

  /run

+ %verify(not md5 size mtime) %config(noreplace) %attr(644,root,root) /run/motd

+ %dir /run/motd.d

  /sbin

  /srv

  %attr(555,root,root) /sys
@@ -237,6 +244,8 @@ 

  %attr(555,root,root) /usr/lib/X11

  %attr(555,root,root) /usr/lib/pm-utils

  %endif

+ %verify(not md5 size mtime) %config(noreplace) %attr(644,root,root) /usr/lib/motd

+ %dir /usr/lib/motd.d

  /usr/libexec

  /usr/local

  %attr(555,root,root) /usr/sbin
@@ -298,6 +307,9 @@ 

  /var/yp

  

  %changelog

+ * Mon Dec 10 2018 Robert Fairley <rfairley@redhat.com> - 3.10-1

+ - add ownership of /run/{motd,motd.d} and /usr/lib/{motd,motd.d} 

+ 

  * Thu Jun 21 2018 Ondrej Vasik <ovasik@redhat.com> - 3.9-1

  - add ownership of /etc/rwtab.d and /etc/statetab.d

  

file added
empty or binary file added
file added
empty or binary file added

This adds ownership of the two directories /run/motd.d and /usr/lib/motd.d and two motd files /run/motd and /usr/lib/motd, which completes ownership of the default motd paths that PAM is now using [1]. Tested installation using the RPM on the fedora/29-cloud-base Vagrant box built in COPR: https://copr-be.cloud.fedoraproject.org/results/rfairley/add-motd-directories/fedora-29-x86_64/00836610-filesystem/, and works as expected.

The /run/motd and /usr/lib/motd files are treated like config files, but I'm thinking it makes sense to keep them in filesystem rather than setup if the motd.d directories are here. To include the files, I needed to add a stub file as a source for each (run.motd and usr-lib.motd) - I appreciate any suggestions for other approaches.

I noticed https://src.fedoraproject.org/rpms/filesystem has a specfile one release higher than this is currently, can also open the PR there if needed.

[1] https://github.com/linux-pam/linux-pam/pull/69

Thanks for PR - my slight preference would be to keep filesystem package directory only - and have the files owned by setup package. Do you have any reason why filesystem package is better place? It doesn't really matter too much, as they are both "very soon installed" packages and I maintain both of them.

My initial thought was to go with filesystem for the /run/... and /usr/lib/... directories as setup looked to mostly have /etc/... files/directories - but either setup or filesystem is good (and setup would be nice to have all the motd-related paths in one place).

I'll take a look at getting the files into setup - I think I can just copy the same motd file with cp -a motd %{buildroot}/run and cp -a motd %{buildroot}/usr/lib which fits with https://pagure.io/fork/rfairley/setup/blob/rfairley-etc-motd-dir-own/f/setup.spec#_34. Will try this out.

Yes, it owns the dirs - but filesystem is supposed to be "directory hierarchy" only - so setup fits better from this perspective. And I agree it would be better to have all files motd related files at one place... and there is already one /var file in setup package, so it is not solely /etc :)

Metadata Update from @ovasik:
- Request assigned

3 months ago