Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

13.9. シングルアプリケーションモード

シングルアプリケーションモードでは、シェルを再構築してインタラクティブなキオスクにします。管理者は標準デスクトップの特定の動作をロックダウンし、ユーザーに対して制限を設けることで特定の機能に特化します。
(通信やエンターテイメント、教育など) 多くのフィールドにおいて幅広い機能でシングルアプリケーションモードを設定することで、セルフサービスマシンやイベントマネージャー、登録ポイントなどとして使用することができます。

手順13.9 シングルアプリケーションモードの設定

  1. 以下の内容で以下のファイルを作成します。
    • /usr/bin/redhat-kiosk
      
      #!/bin/sh
      
      if [ ! -e ~/.local/bin/redhat-kiosk ]; then
          mkdir -p ~/.local/bin ~/.config
          cat > ~/.local/bin/redhat-kiosk << EOF
      #!/bin/sh
      # This script is located in ~/.local/bin.
      # It's provided as an example script to show how
      # the kiosk session works.  At the moment, the script
      # just starts a text editor open to itself, but it
      # should get customized to instead start a full screen
      # application designed for the kiosk deployment.
      # The "while true" bit just makes sure the application gets
      # restarted if it dies for whatever reason.
      
      while true; do
          gedit ~/.local/bin/redhat-kiosk
      done
      
      EOF
      
          chmod +x ~/.local/bin/redhat-kiosk
          touch ~/.config/gnome-initial-setup-done
      fi
      
      exec ~/.local/bin/redhat-kiosk "$@"
      
      重要
      /usr/bin/redhat-kiosk ファイルは実行可能である必要があります。
      gedit ~/.local/bin/redhat-kiosk コードを、kiosk セッションで実行するコマンドに置き換えます。この例では、http://mine-kios-web-app という名前のキオスクデプロイメント用に設計されたフルスクリーンアプリケーションを起動します。
      [...]
      while true; do
          firefox --kiosk http://mine-kios-web-app
      done
      [...]
      
    • /usr/share/applications/com.redhat.Kiosk.Script.desktop
      [Desktop Entry]
      Name=Kiosk
      Type=Application
      Exec=redhat-kiosk
      
    • /usr/share/applications/com.redhat.Kiosk.WindowManager.desktop
      [Desktop Entry]
      Type=Application
      Name=Mutter
      Comment=Window manager
      Exec=/usr/bin/mutter
      Categories=GNOME;GTK;Core;
      OnlyShowIn=GNOME;
      NoDisplay=true
      X-GNOME-Autostart-Phase=DisplayServer
      X-GNOME-Provides=windowmanager;
      X-GNOME-Autostart-Notify=true
      X-GNOME-AutoRestart=false
      X-GNOME-HiddenUnderSystemd=true
      
    • /usr/share/gnome-session/sessions/redhat-kiosk.session
      [GNOME Session]
      Name=Kiosk
      RequiredComponents=com.redhat.Kiosk.WindowManager;com.redhat.Kiosk.Script;
      
    • /usr/share/xsessions/com.redhat.Kiosk.desktop
      [Desktop Entry]
      Name=Kiosk
      Comment=Kiosk mode
      Exec=/usr/bin/gnome-session --session=redhat-kiosk
      DesktopNames=Red-Hat-Kiosk;GNOME;
      
  2. GDM サービスを再起動します。
    systemctl restart gdm.service
  3. kiosk セッション用に別のユーザーを作成し、kiosk セッションのセッションタイプとして Kiosk を選択します。

    図13.1 kiosk セッションの選択

    kiosk セッションの選択
Kiosk セッションを開始すると、ユーザーは kiosk デプロイメント用に設計された完全な screen アプリケーションを起動します。