Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rocky linux 8.6 configure script installs into new weird locations #276

Open
syleishere opened this issue Aug 25, 2022 · 7 comments
Open

Comments

@syleishere
Copy link

After upgrading tools the run directory and sysconfdir have changed
./configure --with-rundir=/var/run --sysconfdir=/etc
is only way I could get it to work again....

where it use to be /etc/ksmbd it is now /usr/local/etc/ksmbd by default, which is not a big deal but the rundir has issues:
tries to use lock files in /usr/local/var/run instead of /var/run, which will prevent ksmbd from starting.

@namjaejeon
Copy link
Member

@syleishere Thanks for your opinion.

@atheik Any opinion about this ?

@syleishere
Copy link
Author

syleishere commented Aug 25, 2022

Well looking at configure.log how runstatedir gets set:
runstatedir='${localstatedir}/run'
looking at where localstatedir gets set:
localstatedir='${prefix}/var'

seems to be the culprit as prefix by default gets set to /usr/local
and I don't believe the intent is to change /var/run to /usr/local/var/run

Quick fix from what I can see since I cannot see anywhere else localstatedir is used other than runstatedir is just setting:
localstatedir='${prefix}/var'
to:
localstatedir='/var'

or:
runstatedir to:
runstatedir='/var/run'

and can get rid of localstatedir completely.

@atheik
Copy link
Member

atheik commented Aug 25, 2022

@syleishere,

ksmbd-tools provides the --with-rundir option for modifiable per-process data. GNU Autoconf also provides the built-in --runstatedir option since the 2.70 release. Many distributions backport this change to earlier versions of autoconf. If --runstatedir is available, its value is used. Otherwise, '${localstatedir}/run' is used, as it's often the default value of --runstatedir. Your autoconf probably has the backported --runstatedir.

If you run ./configure --help, is --runstatedir present? What is its default value? On my system, it's this:

  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]

If --runstatedir is available, and its default value is something other than LOCALSTATEDIR/run, then what you described is a bug. Otherwise, this is working as intended. Also, please read the readme of ksmbd-tools if you have not.

@atheik
Copy link
Member

atheik commented Aug 26, 2022

@syleishere,

Looks like both Rocky Linux 8.6 and 9.0 have GNU autoconf 2.69, but only Rocky Linux 9.0 has the backported --runstatedir option. So, what you described is not a bug and '${localstatedir}/run' is the correct build system default for --with-rundir. And yes, it resolving to /usr/local/var/run when using the /usr/local prefix is intended.

@syleishere
Copy link
Author

Alright, thank-you for responses, perhaps make file could check presence of runstatedir then, if doesn't exist run a mkdir -p against it then so noone else runs up against this issue wondering why ksmd.mount not running if possible.

@atheik
Copy link
Member

atheik commented Aug 26, 2022

@syleishere,

No, the directory should not be created in the install target since nothing is installed there. Also, it cannot be created since it should be under a tmpfs filesystem. Giving some sort of warning message if it does not exist and when DESTDIR is not in use could be possible. Regardless, it is the responsibility of the person running configure to make sure that runstatedir is under a tmpfs filesystem. If --runstatedir is available, its default value can be changed in /usr/share/config.site. The likely need to give --with-rundir or --runstatedir is clearly explained in README.md.

You could have avoided this issue entirely if you had read README.md.

@atheik
Copy link
Member

atheik commented Aug 27, 2022

@syleishere,

One more thing. This configuration that you ended up with is pretty unusual:

./configure --with-rundir=/var/run --sysconfdir=/etc

It almost follows FHS, but not quite, since the utilities (sbindir) end up in /usr/local/sbin. The /usr/local prefix, which is the autoconf default, is typically used to avoid collissions with the distribution's own packages. So, with the above configure invocation, only sysconfdir and runstatedir may collide with ksmbd-tools installed using the package manager. Since you build ksmbd-tools yourself, and don't install it using the package manager, you don't have to worry about this collission. This means that you can use the FHS location for sbindir, which is /usr/sbin.

Rocky Linux actually ships with /usr/share/config.site that enforces FHS when you use the /usr prefix, which is the distribution's default. So, in your case, you only need to give --prefix=/usr to configure:

./configure --prefix=/usr

With this configure invocation, sbindir is /usr/sbin, sysconfdir is /etc, and runstatedir is /var/run because localstatedir is /var. Take a look at /usr/share/config.site on your system to see how it enforces FHS when using the distribution default /usr prefix. Remember to remove the utilities in /usr/local/sbin in case /usr/local/sbin is before /usr/sbin in your PATH.

I hope this cleared things up for you. Please close this issue if it did.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants