ライセンスサーバーのサービスの設定
Set up a service to automatically start the Unity Licensing Server on startup.
読み終わるまでの所要時間 3 分最終更新 6日前
このタスクは、Unity Licensing Server を設定 するための包括的なプロセスの一部です。 ライセンスサーバーをテスト したら、サービスを設定して、起動時にサーバーが自動的に起動するようにできます。プロセスを手動で一時停止、停止、再起動することもできます。 任意ではありますが、サービスを設定することをお勧めします。 サービスを設定した後で、必ずライセンスサーバー設定のバックアップを作成してください。バックアップと復元 を参照してください。
サービスの作成
ライセンスサーバーの停止と起動のためにサービスを作成するには、OS に応じた手順に従います。
Linux でのサービスの作成
create-service- と呼ばれる
unity.licensing.server.serviceサービス単位を作成します。systemd - 現在のルート以外のユーザーアカウントで実行するようにサービスを設定します。
- 起動時に自動的に起動するようにサービスを設定します。
- サービスを起動します。
- サービスを作成するには、以下のコマンドを実行します。
以下のような出力が表示されます。sudo ./Unity.Licensing.Server create-service
- - - -Welcome to Unity Licensing Server create service command line interface.This command line interface will help you create Unity.Licensing.Server service.- - - -Creating service for user 'adminuser' ...Enabling service to start automatically after (re)boot ... DoneStarting service ... Doneunity.licensing.server.service has been successfully created and running.
- サービスのステータスを調べるには、以下のコマンドを実行します。
ターミナルの出力でsudo systemctl status unity.licensing.server.service
Active: active running
Windows でのサービスの作成
create-service-
サービスとしてログオンする権利をユーザーに与えます。ログオンする権利を割り当てるには、以下を行います。
- Windows Search で を検索し、ポリシーエディターを開きます。
Local Security Policy - 左側のメニューで、Security Settings (セキュリティの設定) > Local Policies (ローカルポリシー) > User Rights Assignment (ユーザー権利の割り当て) に移動し、Log on as service (サービスとしてログオン) を選択します。
- Add User or Group (ユーザーまたはグループの追加) をクリックします。
- テキストボックスにユーザー名を入力し、Check Names (名前の確認) > OK をクリックします。
- OK をクリックします。
- Windows Search で
-
サービスを作成するには、昇格された特権で PowerShell ウィンドウを開始し、以下のコマンドを実行します。
.\Unity.Licensing.Server.exe create-service
-
サービスの作成に使用した管理者アカウントのパスワードを入力します。コマンドは以下のような出力を返します。
create-service- - - -Welcome to Unity Licensing Server create service command line interface.This command line interface will help you create Unity.Licensing.Server service.- - - -Enter password for user 'HQ\adminuser': ***********Windows service installation successful!Service Name = Unity.Licensing.ServerDescription = The Unity Licensing Server is a secure web server to host andmanage Unity licenses on your local network -
サービスのステータスを調べるには、以下のコマンドを実行します。
PowerShell ウィンドウの出力でsc.exe query Unity.Licensing.Serverの情報を確認します。STATESERVICE_NAME: Unity.Licensing.ServerTYPE : 10 WIN32_OWN_PROCESSSTATE : 4 RUNNING (STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)WIN32_EXIT_CODE : 0 (0x0)SERVICE_EXIT_CODE : 0 (0x0)CHECKPOINT : 0x0WAIT_HINT : 0x0値にSTATE以外が表示される場合は、Windows サービスを開き、管理するために4 RUNNINGサービスを探します。Unity.Licensing.Server
サービスの再起動
標準の OS コマンドを使用して、ライセンスサーバーサービスを停止または再起動できます。
OS に応じた手順に従います。
Linux でのサービスの再起動
- 以下のコマンドを実行して、ライセンスサーバーサービスを起動または再起動します。
sudo systemctl restart unity.licensing.server.service
- 以下のコマンドを実行して、サービスが実行していることを確認します。
サービスが実行されている場合、コマンドの出力は以下のようになります。sudo systemctl status unity.licensing.server.service | grep Active
Active: active (running) since Fri 2020-02-14 16:44:59 EST; 2s ago
Windows でのサービスの再起動
- 以下のコマンドを実行して、ライセンスサーバーサービスを起動または再起動します。
sc.exe query Unity.Licensing.Server | findstr /i State
- 出力に と表示されている場合は、以下のコマンドを実行してサービスを停止します。
STATE: 4 RUNNING
sc.exe stop Unity.Licensing.Server
- 出力に と表示されている場合は、以下のコマンドを実行してサービスを再起動します。
STATE: 1 STOPPED
sc.exe start Unity.Licensing.Server
- 再びサービスの状態を調べるには、以下のコマンドを実行します。
出力にsc.exe query Unity.Licensing.Server | findstr /i State
STATE: 4 RUNNINGサービスの削除
ライセンスサーバーサービスを削除する必要がある場合は、OS に応じた手順に従います。Linux でのサービスの削除
ライセンスサーバーサービスを削除するには、以下を行います。- 以下のコマンドを実行してサービスを停止します。
sudo systemctl stop unity.licensing.server.service
- 以下のコマンドを実行して、サービスを無効にし、次回の起動時に実行しないようにします。
sudo systemctl disable unity.licensing.server.service
- 以下のコマンドを実行して、サービスが無効になったことを確認します。
サービスが無効になった場合、コマンドの出力は以下のようになります。sudo systemctl status unity.licensing.server.service | grep Loaded
Loaded: loaded (/etc/systemd/system/unity.licensing.server.service; **disabled**; vendor preset: enabled)
- 以下のコマンドを実行して、サービス単位を削除します。
sudo rm -rf /etc/systemd/system/unity.licensing.server.service
- 以下のコマンドを実行して、変更を反映させます。
sudo systemctl daemon-reload
Windows でのサービスの削除
ライセンスサーバーサービスを削除するには、以下を行います。- 以下のコマンドを実行してサービスを停止します。
sc.exe stop Unity.Licensing.Server
- 以下のコマンドを実行して、サーバーのステータスを調べます。
sc.exe query Unity.Licensing.Server | findstr /i State
- 出力に と表示されている場合は、以下のコマンドを実行してサービスを削除します。
STATE: 1 STOPPED
サービスを削除すると、以下のメッセージが表示されます。sc.exe delete Unity.Licensing.Server
[SC] DeleteService SUCCESS