Fedoraにguix-daemon.serviceのSELinuxポリシーをインストールするには?

Fedoraにguix-daemon.serviceのSELinuxポリシーをインストールするには?

Guixのインストール後にバンドルされたSELinuxポリシーを実行するには、どのようにインストールする必要がありますかguix-daemon.service

Fedora 34ワークステーションにGuix 1.3.0をインストールするには、以下を使用しました。シェルインストーラスクリプト:

$ cd /tmp
$ wget https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh
$ chmod +x guix-install.sh
$ sudo ./guix-install.sh

スクリプトが正常に完了しました。プロンプトを隠してインストールしました。ネームサービスキャッシュデーモン:

$ sudo dnf install nscd
$ sudo systemctl enable nscd
$ sudo systemctl start nscd

残念ながら私はできませんインストールの継続glibc-localesguix-daemon.service実行されていないので:

$ guix install glibc-locales
hint: Consider installing the `glibc-utf8-locales' or `glibc-locales' package and defining `GUIX_LOCPATH', along these lines:

     guix install glibc-utf8-locales
     export GUIX_LOCPATH="$HOME/.guix-profile/lib/locale"

See the "Application Setup" section in the manual, for more info.

guix install: error: failed to connect to `/var/guix/daemon-socket/socket': No such file or directory
$ systemctl status guix-daemon
× guix-daemon.service - Build daemon for GNU Guix
     Loaded: loaded (/etc/systemd/system/guix-daemon.service; enabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Thu 2021-08-19 21:12:26 EEST; 2h 29min ago
   Main PID: 793 (code=exited, status=203/EXEC)
        CPU: 1ms

сер 19 21:12:26 fedora systemd[1]: Started Build daemon for GNU Guix.
сер 19 21:12:26 fedora systemd[793]: guix-daemon.service: Failed to locate executable /var/guix/profiles/per-user/root/current-guix/bin/guix-daemon: Permission denied
сер 19 21:12:26 fedora systemd[793]: guix-daemon.service: Failed at step EXEC spawning /var/guix/profiles/per-user/root/current-guix/bin/guix-daemon: Permission denied
сер 19 21:12:26 fedora systemd[1]: guix-daemon.service: Main process exited, code=exited, status=203/EXEC
сер 19 21:12:26 fedora systemd[1]: guix-daemon.service: Failed with result 'exit-code'.
сер 19 23:35:07 fedora systemd[1]: /etc/systemd/system/guix-daemon.service:12: Standard output type syslog is obsolete, automatically updating to journal. Please update your unit file, and consider removing the setting altogether.
сер 19 23:35:07 fedora systemd[1]: /etc/systemd/system/guix-daemon.service:13: Standard output type syslog is obsolete, automatically updating to journal. Please update your unit file, and consider removing the setting altogether.

~によると手動:

etc/guix-daemon.cilGuixには、SELinuxサポートシステムにインストールしてGuixファイルを表示し、デーモンの期待される動作を指定できるSELinuxポリシーファイルが含まれています。

Libera Chatチャンネルの人々は、#guix上記の手順がgitで手動でコンパイルされたGuixで動作することを理解するのに役立ちました。シェルインストーラスクリプトを使用してインストールされたGuixの場合は、次のファイルを見つける必要があります/gnu/store

$ find /gnu -name guix-daemon.cil
/gnu/store/0iii8i1lc4wg3wccs1db7y7d8lg80i04-guix-1.3.0/share/selinux/guix-daemon.cil
$ cd /gnu/store/0iii8i1lc4wg3wccs1db7y7d8lg80i04-guix-1.3.0/share/selinux/
$ sudo semodule -i guix-daemon.cil

今、マニュアルによると:

restorecon次に、システムによって提供される他のメカニズムを使用してファイルシステムのラベルを再割り当てします。

私は試した:

$ sudo restorecon -vR /gnu

これは多くを返す

restorecon: Could not set context for /gnu/…:  Read-only file system

たとえば、

$ find /gnu -name guix-daemon.service
/gnu/store/0iii8i1lc4wg3wccs1db7y7d8lg80i04-guix-1.3.0/lib/systemd/system/guix-daemon.service
$ sudo restorecon -v /gnu/store/0iii8i1lc4wg3wccs1db7y7d8lg80i04-guix-1.3.0/lib/systemd/system/guix-daemon.service
restorecon: Could not set context for /gnu/store/0iii8i1lc4wg3wccs1db7y7d8lg80i04-guix-1.3.0/lib/systemd/system/guix-daemon.service:  Read-only file system

そしてデーモンはまだ起動していません。

私の考えでは、問題はSELinuxの設定やFedoraがこれをどのように処理するかに関連しているようですが、直接調査する方法を理解できません。 Guix 問題トラッカーの検索「読み取り専用ファイルシステム」「SELinux」無関係な質問2つだけが返されました。

ベストアンサー1

公開されたguixインストールスクリプトを見た結果、/ gnuをインストールするためにsystemdを介してマウントポイントを作成するようです。これを行うインストールスクリプトの一部は次のとおりです。

{#systemd .mountユニットの名前は、ターゲットディレクトリの名前に従って指定する必要があります。 #ここでは、ハードコードされた名前が/ gnu / storeであるとします。 #XXXソリューションhttps://issues.guix.gnu.org/41356次のバージョンまで。 if [ -f "~root/.config/guix/current/lib/systemd/system/gnu-store.mount" ] then cp "~root/.config/guix/current/lib/systemd/system/gnu- store .mount"
/etc/systemd/system/; chmod 664 /etc/systemd/system/gnu-store.mount; systemctl daemon-reload && systemctlを有効にするgnu-store.mount;

したがって、これは次のファイルが存在する必要があることを意味します。gnu-store.mount体系的に。詳しく見てみると、次のような内容がありました。

[Unit]
Description=Read-only @storedir@ for GNU Guix
DefaultDependencies=no
ConditionPathExists=@storedir@
Before=guix-daemon.service

[Install]
WantedBy=guix-daemon.service

[Mount]
What=@storedir@
Where=@storedir@
Type=none
Options=bind,ro

Options=bind,ro を見ると確かに読み取り専用なので、rw に変更して再マウントしてから Restoreconn を使用してラベルを再指定する必要があります。説明で判断すればこのままではいけないようですが試してみましょう。これが役に立つことを願っています

おすすめ記事