[scl.org] Names under /var/opt, /etc/opt

Honza Horak hhorak at redhat.com
Thu Feb 26 19:28:43 UTC 2015


After some discussions with QE that preferred variant (B) as well and 
since there is no opinion that would prefer variant (A), lets call this 
a decision. Something based on the summary bellow will be added into the 
documentation [1]:

TL;DR version, this is the correct location for files for sample package 
foo in fooX collection:

original locations (in sample non-SCL package):
/var/log/foo/food.log
/var/lock/subsys/food
/var/run/food.pid

locations in fooX SCL:
/var/opt/<vendor>/scls/fooX/log/foo/food.log
/var/lock/subsys/fooX-food
/var/run/fooX-food.pid


Longer text, which may be added to the doc [1]:

Configuration and variable files locations depend on %{nfsmountable} 
macro. Using this macro is strongly recommended, but for backward 
compatibility it is not defined by default.

If the %{nfsmountable} macro is not defined, %{_sysconfdir} expands into 
/opt/<vendor>/<scl>/root/etc and %{_localstatedir} expands to 
/opt/<vendor>/<scl>/root/var.

If the %{nfsmountable} macro is defined, %{_sysconfdir} expands into 
/etc/opt/<vendor>/scls/<scl> and %{_localstatedir} expands to 
/var/opt/<vendor>/scls/<scl>.


Software Collection Log File Support:
Log files should be located in %{_localstatedir}/log/<original-path>
where <original-path> does not contain any other SCL prefixes any more.

For example, if daemon foo stores the log file into 
/var/log/foo/food.log in the base system and the macro %{nfsmountable} 
is defined, the path in the fooX collection will be 
/var/opt/<vendor>/scls/fooX/log/foo/food.log.

Software Collection Support for files under /var/run:
PID files are one example of files usually located under 
/var/run/<pgkname> directory. In the Software Collection the recommended 
PID file location is to use /var/run/<scl>-<pkgname> directory, so there 
are no conflicts with files shipped by packages from the base system, 
but Software Collection can use features of /var/run, for example tmpfs 
filesystem for pid files.

Software Collection Support for SysV init lock files:
SysV init files require to use lock files under /var/lock/subsys while 
the file under that directory is usually the same as the service name. 
Since service name is already prefixed by SCL name, we can use the same 
rule for SCL packages, since using the daemon name under 
/var/lock/subsys will ensure the lock file won't conflict with the base 
system lock files.

[1] https://www.softwarecollections.org/en/docs/guide/

Honza

On 02/17/2015 12:45 PM, Honza Horak wrote:
> This is about files under /var/opt and potentially /etc/opt when we use
> %nfsmountable in new scl-utils. Basic question: do we want to prefix
> file names in cases the location path already includes the SCL name?
>
> Simple answer would be "no, it's not needed". (variant B)
>
> However, there is another PoV -- pid files, log files, lock files, etc.
> have been traditionally called the same as the daemon, so someone can
> assume this convention will be kept in SCLs (variant A)
>
> So, how it looks in practice:
>
> variant A)
> Keeping the pid/log files names the same as the daemon:
> /var/opt/rh/scls/rh-mariadb100/log/mariadb/rh-mariadb100-mariadb.log
> /var/opt/rh/scls/rh-mariadb100/run/rh-mariadb100-mariadb/rh-mariadb100-mariadb.pid
>
>
> variant B)
> If we don't include prefix (we break the convention), the location seems
> nicer:
> /var/opt/rh/scls/rh-mariadb100/log/mariadb/mariadb.log
> /var/opt/rh/scls/rh-mariadb100/run/mariadb/mariadb.pid
>
> I like the (B) variant more, just keep it more simple and just break the
> custom to name pid/log files the same as the deamon.
>
> However, I'd appreciate any input on this.
>
> Honza
>
> _______________________________________________
> SCLorg mailing list
> SCLorg at redhat.com
> https://www.redhat.com/mailman/listinfo/sclorg




More information about the SCLorg mailing list