smartd.service needs a bit adaptation to fit well in gentoo. By default the EnvironmentFile points to /etc/sysconfig/smartmontools while Gentoo uses /etc/conf.d/smartd. The stock sysv init script and the service file assume the file provides smartd_opts (lower-case) in the Gentoo file it is rather SMARTD_OPTS. The attached patches do this for 6.1 and 6.3. In 6.3 there is a parameter for the configure script `--with-systemdenvfile' to choose the environment file appropriately. Reproducible: Always
Created attachment 387898 [details, diff] Adapt smartd.service for Gentoo (6.1)
Created attachment 387900 [details, diff] Adapt smartd.service for Gentoo (6.1)
Created attachment 387902 [details, diff] Adapt smartd.service for Gentoo (6.3)
Well, /etc/conf.d is not the system's configuration path like Debian's /etc/default or Red Hat's /etc/sysconfig. The path is used by OpenRC and systemd folk in Gentoo don't want that any systemd unit make use of these files. Also keep in mind that in systemd's world you will simply overwrite the default service. So I will update the provided systemd unit for smartd to get rid of EnvironmentFile and $smartd_opts. Users who want to pass options should follow systemd and overwrite the unit for their needs.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ad8950f967e37dcff1fb1ab9fcd2e0b4001b0a69 commit ad8950f967e37dcff1fb1ab9fcd2e0b4001b0a69 Author: Thomas Deutschmann <whissi@gentoo.org> AuthorDate: 2017-10-31 21:51:15 +0000 Commit: Thomas Deutschmann <whissi@gentoo.org> CommitDate: 2017-10-31 21:52:56 +0000 sys-apps/smartmontools: Rev bump to address several problems - EAPI updated to EAPI 6. - Depend on sys-freebsd/freebsd-lib[usb] on FreeBSD. (bug #552054) - Update smartd systemd service to reflect that we don't provide a general config file for the service. Users are supposed to overwrite the provided service if they want to pass additional parameters. (bug #527648) - We no longer install executable files in /usr/share/{PN}. (bug #622072) - "minimal" USE flag was replaced by "daemon" USE flag to better indicate what the USE flag does. - "caps" USE flag now requires "daemon" USE flag. - It is now possible to use the "update_drivedb" USE flag alone (i.e. without the "minimal", now "daemon" USE flag). (bug #635700) - The drive database logic was rewritten: Per default we try to install the drive database shipped with the package. If there's already a drive database installed we will not replace the database anymore in assumption that the user has updated the database in the meantime and want to preserve the changes. A warning will be displayed in this case with an instruction how to update or restore the default drive database shipped with the package. The new logic now also works when using binary packages. (bug #575292) - RDEPENDs on net-misc/curl, net-misc/wget, www-client/lynx and dev-vcs/subversion (just one of them is required!) were added when using "update_drivedb" USE flag. Closes: https://bugs.gentoo.org/552054 Closes: https://bugs.gentoo.org/527648 Closes: https://bugs.gentoo.org/622072 Closes: https://bugs.gentoo.org/635700 Closes: https://bugs.gentoo.org/575292 Package-Manager: Portage-2.3.13, Repoman-2.3.4 sys-apps/smartmontools/files/smartd.systemd | 11 ++ sys-apps/smartmontools/metadata.xml | 2 + sys-apps/smartmontools/smartmontools-6.5-r1.ebuild | 148 +++++++++++++++++++++ 3 files changed, 161 insertions(+)