Hodokami

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: kusanagi restartに失敗する #1673
    Hodokami
    Participant

      hideishi さん
      ありがとうございます。結論から申し上げると私の方の問題は解消いたしました。

      systemctl restart kusanagi では解消しませんでした。その際の /var/opt/kusanagi/log/kusanagi/backend.log は以下のようになっておりました。

      
      Traceback (most recent call last):
        File "/opt/kusanagi/python312/lib64/python3.12/site-packages/kusanagi/_k10/executor.py", line 180, in async_execute_command
          process = await asyncio.create_subprocess_exec(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/kusanagi/python312/lib64/python3.12/asyncio/subprocess.py", line 224, in create_subprocess_exec
          transport, protocol = await loop.subprocess_exec(
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/kusanagi/python312/lib64/python3.12/asyncio/base_events.py", line 1756, in subprocess_exec
          transport = await self._make_subprocess_transport(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/kusanagi/python312/lib64/python3.12/asyncio/unix_events.py", line 211, in _make_subprocess_transport
          transp = _UnixSubprocessTransport(self, protocol, args, shell,
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/kusanagi/python312/lib64/python3.12/asyncio/base_subprocess.py", line 36, in __init__
          self._start(args=args, shell=shell, stdin=stdin, stdout=stdout,
        File "/opt/kusanagi/python312/lib64/python3.12/asyncio/unix_events.py", line 820, in _start
          self._proc = subprocess.Popen(
                       ^^^^^^^^^^^^^^^^^
        File "/opt/kusanagi/python312/lib64/python3.12/subprocess.py", line 1026, in __init__
          self._execute_child(args, executable, preexec_fn, close_fds,
        File "/opt/kusanagi/python312/lib64/python3.12/subprocess.py", line 1955, in _execute_child
          raise child_exception_type(errno_num, err_msg, err_filename)
      FileNotFoundError: [Errno 2] No such file or directory: '/opt/kusanagi/nginx/sbin/nginx'
      
      The above exception was the direct cause of the following exception:
      
      Traceback (most recent call last):
        File "/opt/kusanagi/python312/lib64/python3.12/site-packages/kusanagi/_k10/importer.py", line 284, in async_dispatch_stream
          await self._dispatcher.async_action(
        File "/opt/kusanagi/python312/lib64/python3.12/site-packages/kusanagi/_k10/decorators.py", line 225, in wrapper
          returncode = await func(
                       ^^^^^^^^^^^
        File "/opt/kusanagi/python312/lib64/python3.12/site-packages/kusanagi/dispatchers/restart.py", line 55, in async_action
          returncode = await super().async_action(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/kusanagi/python312/lib64/python3.12/site-packages/kusanagi/_k10/dispatchers/restart.py", line 61, in async_action
          returncode = await service.async_test(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/kusanagi/python312/lib64/python3.12/site-packages/kusanagi/_k10/service/mixins/group.py", line 216, in async_test
          await unit.async_test(
        File "/opt/kusanagi/python312/lib64/python3.12/site-packages/kusanagi/_k10/service/units/nginx.py", line 151, in async_test
          return await async_execute_command(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/kusanagi/python312/lib64/python3.12/site-packages/kusanagi/_k10/executor.py", line 210, in async_execute_command
          raise KusanagiExecutionError(
      kusanagi._k10.errors.KusanagiExecutionError: '/opt/kusanagi/nginx/sbin/nginx -t -c /etc/opt/kusanagi/nginx/nginx.conf' returned 2
      

      そこで /etc/systemd/system/multi-user.target.wants/ を確認したところリンク切れの nginx.service が確かに存在しました。

      
      $ ls -la /etc/systemd/system/multi-user.target.wants/ | grep nginx
      lrwxrwxrwx.  1 root root   37 12月 19  2023 nginx.service -> /usr/lib/systemd/system/nginx.service
      lrwxrwxrwx.  1 root root   40  6月 11 10:54 nginx131.service -> /usr/lib/systemd/system/nginx131.service
      

      こちらのシンボリックリンクを削除したところ kusanagi restart が完走するようになりました。ありがとうございました。

      
      $ kusanagi restart
      nginx: the configuration file /etc/opt/kusanagi/nginx/nginx.conf syntax is ok
      nginx: configuration file /etc/opt/kusanagi/nginx/nginx.conf test is successful
      [29-Jul-2026 09:59:09] NOTICE: configuration file /etc/opt/kusanagi/php-fpm.conf test is successful
      restart completed.
      
      in reply to: kusanagi restartに失敗する #1668
      Hodokami
      Participant

        hideishi さん

        kusanagi statusおよびkusanagi nginx --showpathの結果は以下のようになっております。

        
        $ kusanagi status
        KUSANAGI Version 9.10.1-1.el9
        sakura
        CentOS Stream 9
        
        *** (active) nginx : nginx131 ***
        ● nginx131.service - The NGINX HTTP and reverse proxy server
             Loaded: loaded (/usr/lib/systemd/system/nginx131.service; enabled; preset: disabled)
             Active: active (running) since Tue 2026-07-28 16:04:13 JST; 2h 38min ago
        
        *** (inactive) httpd : httpd24 ***
        ○ httpd.service - The Apache HTTP Server
             Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; preset: disabled)
             Active: inactive (dead)
        
        *** (active) php : php85 ***
        ● php-fpm.service - The PHP FastCGI Process Manager
             Loaded: loaded (/usr/lib/systemd/system/php-fpm.service; enabled; preset: disabled)
             Active: active (running) since Mon 2026-07-27 14:38:27 JST; 1 day 4h ago
        
        *** (active) mariadb : mariadb ***
        ● mariadb.service - MariaDB 12.3.2 database server
             Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; preset: disabled)
             Active: active (running) since Mon 2026-07-27 14:38:29 JST; 1 day 4h ago
        
        *** (inactive) psql :  ***
        
        *** (inactive) pgpool-II :  ***
        
        *** python ***
        Python 3.12.13
        
        *** Cache status ***
        
        *** WAF ***
        off
        
        *** SELinux ***
        on
        
        status completed.
        
        $ kusanagi nginx --showpath
        /opt/kusanagi/nginx131/sbin/nginx
        nginx completed.
        
        Hodokami
        Participant

          追加になりますが、
          KUSANAGI 9 for Vagrant / KUSANAGI for Vagrant
          及び
          KUSANAGI 9クイックスタート
          を参照する限りではVagrant上のKUSANAGIでsudo su -でrootになるためにパスワードは特に設定されてないように見受けられます。

          Hodokami
          Participant

            初めまして、VPSでのKUSANAGI9ユーザーの者です。

            VBOX上でのKUSANAGIと異なる可能性があることを踏まえての回答になりますが、

            Vagrant上のKUSANAGI9にSSH接続できていらっしゃるかと思いますが、KUSANAGI9の初期設定である
            kusanagi init
            コマンドは実行されましたでしょうか。このコマンドにおいてkusanagiユーザーのパスワードを設定し、この時点でkusanagiユーザーが設定されるものと考えております。
            そのためinitを実行していないのでしたらそもそもkusanagiユーザーへのログインは不可能かと思います。
            なお、initはsudo可能なアカウントで実行するものであると考えています。

          Viewing 4 posts - 1 through 4 (of 4 total)