systemdによる管理を無効にするためのTimesTenインスタンスの変更

この例では、myinstance_2 TimesTenインスタンスがsystemdで構成されていることを前提としています。tt_myinstance_2 TimesTenサービスは実行中で、systemdの自動管理中です。この例では、systemd構成を削除するようにインスタンスを変更するプロセスを順を追って説明します。次に、tt_myinstance_2 TimesTenサービスを停止し、TimesTenデーモンの手動制御に戻すために必要なステップを実行します。

  1. systemdのsystemctl statusコマンドを使用して、 tt_myinstance_2 TimesTenサービスが実行されていることを確認します。
    % systemctl status tt_myinstance_2.service
    ● tt_myinstance_2.service - TimesTen Service
       Loaded: loaded (/lib/systemd/system/tt_myinstance_2.service; enabled; vendor preset: disabled)
       Active: active (running) since Wed 2021-08-18 05:55:00 PDT; 39s ago
      Process: 30976 ExecStart=/scratch/ttuser2/myinstance_2/bin/ttDaemonAdmin -start -force -systemd (code=exited, status=0/SUCCESS)
     Main PID: 30984 (timestend)
       Memory: 53.3M
       CGroup: /system.slice/tt_myinstance_2.service
               ├─30984 /scratch/ttuser2/myinstance_2/install/bin/timestend -init...
               ├─30988 installation_dir/tt22.1.1.29.0/bin/timestensubd -ve...
               ├─30989 installation_dir/tt22.1.1.29.0/bin/timestensubd -ve...
               └─30991 installation_dir/tt22.1.1.29.0/bin/ttcserver -verbo...
  2. -nosystemdオプションを指定して$TIMESTEN_HOME/bin/ttInstanceModifyユーティリティを実行します。TimesTenは、systemd構成を削除するようにインスタンスを変更します。
    % $TIMESTEN_HOME/bin/ttInstanceModify -nosystemd
    The daemon for instance 'myinstance_2' is currently configured to be managed by systemd.
    
    Unconfiguring TimesTen daemon startup from systemd
    
    ** NOTICE **
    
    If the TimesTen daemon startup scripts were installed, you must run
            $TIMESTEN_HOME/bin/setuproot -uninstall -systemd
    to remove them.
    
  3. TimesTenのttStatusユーティリティを実行して、myinstance_2インスタンスがsystemd用に構成されていないことを示します。
    % $TIMESTEN_HOME/bin/ttStatus
    TimesTen status report as of Wed Aug 18 13:25:31 2021
    
    Daemon pid 30984 port 6640 instance myinstance_2
    TimesTen server pid 30991 started on port 6641
    ------------------------------------------------------------------------
    ------------------------------------------------------------------------
    Accessible by group g900
    End of report
    
  4. systemdのsystemctl statusコマンドを実行して、tt_myinstance_2 TimesTenサービスがまだ実行されていることを示します。
    % systemctl status tt_myinstance_2.service
    ● tt_myinstance_2.service - TimesTen Service
       Loaded: loaded (/lib/systemd/system/tt_myinstance_2.service; enabled; vendor preset: disabled)
       Active: active (running) since Wed 2021-08-18 05:55:00 PDT; 29min ago
      Process: 30976 ExecStart=/scratch/ttuser2/myinstance_2/bin/ttDaemonAdmin -start -force -systemd (code=exited, status=0/SUCCESS)
     Main PID: 30984 (timestend)
       Memory: 53.8M
       CGroup: /system.slice/tt_myinstance_2.service
               ├─30984 /scratch/ttuser2/myinstance_2/install/bin/timestend -init...
               ├─30988 installation_dir/tt22.1.1.1.0/bin/timestensubd -ve...
               ├─30989 installation_dir/tt22.1.1.1.0/bin/timestensubd -ve...
               └─30991 installation_dir/tt22.1.1.1.0/bin/ttcserver -verbo...
  5. rootユーザーとして、$TIMESTEN_HOME/bin/setuproot -uninstall -systemdスクリプトを実行して、tt_myinstance_2 TimesTenサービスを無効にして停止します。
    # $TIMESTEN_HOME/bin/setuproot -uninstall -systemd  
    Would you like to uninstall the TimesTen daemon startup scripts in /lib/systemd/system? [ yes ]
    Removed symlink /etc/systemd/system/tt_myinstance_2.service.
    Removed symlink /etc/systemd/system/multi-user.target.wants/tt_myinstance_2.service.
    
    Successfully deleted the following scripts :
    /lib/systemd/system/tt_myinstance_2.service
    
  6. systemdのsystemctl statusコマンドを実行して、systemdがもうTimesTenデーモンを管理していないことを確認します。
    % systemctl status tt_myinstance_2.service
    ● tt_myinstance_2.service - TimesTen Service
       Loaded: loaded (/usr/lib/systemd/system/tt_myinstance_2.service; bad; vendor preset: disabled)
       Active: failed (Result: exit-code) since Wed 2021-08-18 06:39:57 PDT; 2min 13s ago
     Main PID: 30984 (code=exited, status=0/SUCCESS)
    Warning: tt_myinstance_2.service changed on disk. Run 'systemctl daemon-reload' to reload units.
    
  7. TimesTenのttStatusユーティリティを実行します。TimesTenデーモンは実行されなくなり、インスタンス管理者の手動制御下になります。インスタンス管理者として、TimesTenのttDaemonAdminを使用して、TimesTenデーモンを手動で起動します。次に、ttStatusユーティリティを使用して、TimesTenデーモンが実行されていることを確認します。
    % ttStatus
    ttStatus: Could not connect to the TimesTen daemon on port 6640.
    If the TimesTen daemon is not running, please start it
    by running "ttDaemonAdmin -start".
    /scratch/ttuser2/myinstance_2/info/daemon.status says:
    2021-08-18 12:55:00 TimesTen daemon starting up
    
    % ttDaemonAdmin -restart
    ttDaemonAdmin: daemon is not running
    TimesTen Daemon (PID: 7060, port: 6640) startup OK.
    
    % ttStatus
    TimesTen status report as of Wed Aug 18 06:53:52 2021
    
    Daemon pid 7060 port 6640 instance myinstance_2
    TimesTen server pid 7067 started on port 6641
    ------------------------------------------------------------------------
    ------------------------------------------------------------------------
    Accessible by group g900
    End of report
    
インスタンスを正常に変更して、systemd構成を削除しました。さらに、systemdによるTimesTenデーモンの自動管理を停止するステップを実行しました。インスタンス管理者は、TimesTenデーモンを手動で管理するようになりました。