📢 Webサイト閉鎖と移転のお知らせ
このWebサイトは2026年9月に閉鎖いたします。
新しい記事は移転先で追加しております。(旧サイトでは記事を追加しておりません)

 
(同じ利用者による、間の5版が非表示)
656行目: 656行目:
<br>
<br>
次に、PCを再起動する。<br>
次に、PCを再起動する。<br>
<br><br>
== セキュリティ ==
==== SELinuxからAppArmorへ切り替え ====
openSUSE TumbleweedがApparmorの代わりにSELinuxをデフォルトで出荷するようになったため、この変更はSUSE 16にも適用された。<br>
<u>SELinuxと互換性のないパッケージが存在するものがあるため、AppArmorが必要になる場合がある。</u><br>
<br>
まず、AppArmorをインストールする。<br>
sudo zypper install --type pattern apparmor
<br>
次に、/etc/default/grubファイルを編集する。<br>
sudo vi /etc/default/grub
<br>
# 編集前
GRUB_CMDLINE_LINUX_DEFAULT="BOOT_IMAGE=(hd0)/boot/x86_64/loader/linux mitigations=auto quiet security=selinux selinux=1 enforcing=1"
# 編集後
GRUB_CMDLINE_LINUX_DEFAULT="BOOT_IMAGE=(hd0)/boot/x86_64/loader/linux mitigations=auto quiet security=apparmor"
<br>
GRUB設定を再構築して、PCを再起動する。<br>
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
sudo systemctl reboot
<br>
再起動後、AppArmorのステータスを確認する。<br>
aa-status
# または
sudo systemctl status apparmor
<br>
SELinuxが無効になっているかどうかを確認する。<br>
sudo getenforce
<br>
最後に、BOOT_IMAGEパラメータが正常に編集されているかどうかを確認する。
more /proc/cmdline
# 出力例
BOOT_IMAGE=(hd0)/boot/x86_64/loader/linux mitigations=auto quiet security=apparmor
<br>
==== AppArmorからSELinuxへ切り替え ====
SUSE 16ではSELinuxがデフォルトとなっているため、この手順は標準構成に戻す場合にも有用である。<br>
<br>
まず、SELinuxパターンをインストールする。<br>
sudo zypper install --type pattern selinux
<br>
次に、/etc/default/grubファイルを以下に示すように編集する。<br>
sudo vi /etc/default/grub
<br>
# 編集前
GRUB_CMDLINE_LINUX_DEFAULT="BOOT_IMAGE=(hd0)/boot/x86_64/loader/linux mitigations=auto quiet security=apparmor"
# 編集後
GRUB_CMDLINE_LINUX_DEFAULT="BOOT_IMAGE=(hd0)/boot/x86_64/loader/linux mitigations=auto quiet security=selinux selinux=1 enforcing=1"
<br>
GRUBの設定を再構築して、PCを再起動する。<br>
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
sudo systemctl reboot
<br>
再起動後、SELinuxのステータスを確認する。<br>
sudo getenforce
# 出力例
Enforcing
<br>
詳細なステータスを確認する。<br>
sudo sestatus
<br>
AppArmorが無効になっているかどうかを確認する。<br>
sudo systemctl status apparmor
<br>
BOOT_IMAGEパラメータが正常に編集されているかどうかを確認する。<br>
more /proc/cmdline
# 出力例
BOOT_IMAGE=(hd0)/boot/x86_64/loader/linux mitigations=auto quiet security=selinux selinux=1 enforcing=1
<br>
==== 注意事項 ====
SELinuxに切り替えた後、システムのポリシーとラベルが正しく設定されるまで、初回起動時に時間が掛かる場合がある。<br>
<br>
また、一部のアプリケーションやサービスでSELinuxポリシーの調整が必要になる場合がある。<br>
<br><br>
<br><br>


674行目: 752行目:
== シャットダウンおよび再起動の待ち時間の変更 ==
== シャットダウンおよび再起動の待ち時間の変更 ==
シャットダウンおよび再起動時において、"a stop job is running for 〜"と表示されて、1分30秒の待ち時間が入る場合がある。<br>
シャットダウンおよび再起動時において、"a stop job is running for 〜"と表示されて、1分30秒の待ち時間が入る場合がある。<br>
この待ち時間を変更するには、/etc/systemd/system.confファイルに、以下の設定を追記する。<br>
この待ち時間を変更するには、/etc/systemd/system.confファイル等に、以下に示す設定を追加する。<br>
<br>
<br>
以下の例では、待ち時間を15秒に設定している。<br>
以下の例では、待ち時間を15秒に設定している。<br>
  sudo nano /etc/systemd/system.conf
  sudo vi /etc/systemd/system.conf
# または ドロップインファイルを使用
sudo mkdir -p /etc/systemd/system.conf.d/
sudo vi /etc/systemd/system.conf.d/timeout.conf
<br>
<br>
<syntaxhighlight lang="ini">
  # /etc/systemd/system.confファイル
  # /etc/systemd/system.confファイル
# または
# /etc/systemd/system.conf.d/timeout.confファイル
   
   
[Manager]
  DefaultTimeoutStartSec=15s
  DefaultTimeoutStartSec=15s
  DefaultTimeoutStopSec=15s
  DefaultTimeoutStopSec=15s
DefaultTimeoutAbortUSec=15s
</syntaxhighlight>
<br>
設定を再読み込みする。<br>
sudo systemctl daemon-reload
<br>
設定を確認する。<br>
systemctl show | grep DefaultTimeout
# 出力例
DefaultTimeoutStartUSec=15s
DefaultTimeoutStopUSec=15s
DefaultTimeoutAbortUSec=15s
<br><br>
<br><br>


1,010行目: 1,110行目:


{{#seo:
{{#seo:
|title={{PAGENAME}} - Electronic Circuits and SUSE Linux
|title={{PAGENAME}} : Exploring Electronics and SUSE Linux | MochiuWiki
|keywords=MochiuWiki,Mochiu,Wiki,Mochiu Wiki,Electric Circuit,Electric,pcb,Mathematics,AVR,TI,STMicro,AVR,ATmega,MSP430,STM,Arduino,Xilinx,FPGA,Verilog,HDL,PinePhone,Pine Phone,Raspberry,Raspberry Pi,C,C++,C#,Qt,Qml,MFC,Shell,Bash,Zsh,Fish,SUSE,SLE,Suse Enterprise,Suse Linux,openSUSE,open SUSE,Leap,Linux,uCLnux,電気回路,電子回路,基板,プリント基板
|keywords=MochiuWiki,Mochiu,Wiki,Mochiu Wiki,Electric Circuit,Electric,pcb,Mathematics,AVR,TI,STMicro,AVR,ATmega,MSP430,STM,Arduino,Xilinx,FPGA,Verilog,HDL,PinePhone,Pine Phone,Raspberry,Raspberry Pi,C,C++,C#,Qt,Qml,MFC,Shell,Bash,Zsh,Fish,SUSE,SLE,Suse Enterprise,Suse Linux,openSUSE,open SUSE,Leap,Linux,uCLnux,電気回路,電子回路,基板,プリント基板
|description={{PAGENAME}} - 電子回路とSUSE Linuxに関する情報 | This page is {{PAGENAME}} in our wiki about electronic circuits and SUSE Linux
|description={{PAGENAME}} - 電子回路とSUSE Linuxに関する情報 | This page is {{PAGENAME}} in our wiki about electronic circuits and SUSE Linux