klt
Ezt nem értem:
sh xfirestart.sh
xfirestart.sh: 2: cd: can't cd to /opt/PFire/src/PFire.Console/
Could not execute because the specified command or file was not found.
Possible reasons for this include:

  • You misspelled a built-in dotnet command.
    does not exist. to execute a .NET program, but dotnet-run
  • You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

De még hagyján ugyanazt a hibát dobja service-ben mint azelőtt.:

● xfirepfire.service - Xfire szerver
   Loaded: loaded (/etc/systemd/system/xfirepfire.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2023-05-01 21:33:40 CEST; 5s ago
  Process: 9619 ExecStart=/opt/xfirestart.sh (code=exited, status=203/EXEC)
 Main PID: 9619 (code=exited, status=203/EXEC)

máj 01 21:33:40 panel systemd[1]: Started Xfire szerver.
máj 01 21:33:40 panel systemd[9619]: xfirepfire.service: Failed to execute command: No such file or directory
máj 01 21:33:40 panel systemd[9619]: xfirepfire.service: Failed at step EXEC spawning /opt/xfirestart.sh: No suc
máj 01 21:33:40 panel systemd[1]: xfirepfire.service: Main process exited, code=exited, status=203/EXEC
máj 01 21:33:40 panel systemd[1]: xfirepfire.service: Failed with result 'exit-code'.

Ilyen ha terminálban kézzel indítom:

root@panel:/opt/PFire/src/PFire.Console# dotnet run
[21:36:44 DBG] An 'IServiceProvider' was created for internal use by Entity Framework.
[21:36:45 DBG] No relationship from 'Friend' to 'User' has been configured by convention because there are multiple properties on one entity type {'Me', 'Them'} that could be matched with the properties on the other entity type {'FriendsOf', 'MyFriends'}. This message can be disregarded if explicit configuration has been specified in 'OnModelCreating'.
  • klt válaszolt erre.

    klt

    ● xfirepfire.service - Xfire szerver
       Loaded: loaded (/etc/systemd/system/xfirepfire.service; enabled; vendor preset: enabled)
       Active: failed (Result: exit-code) since Mon 2023-05-01 21:40:11 CEST; 1s ago
      Process: 10834 ExecStart=/opt/xfirestart.sh (code=exited, status=203/EXEC)
     Main PID: 10834 (code=exited, status=203/EXEC)
    
    máj 01 21:40:11 panel systemd[1]: Started Xfire szerver.
    máj 01 21:40:11 panel systemd[1]: xfirepfire.service: Main process exited, code=exited, status=203/EXEC
    máj 01 21:40:11 panel systemd[1]: xfirepfire.service: Failed with result 'exit-code'.

    sh file kézzel futtatva:

    Couldn't find a project to run. Ensure a project exists in /opt, or pass the path to the project using --project.

    mennydorges can't cd to /opt/PFire/src/PFire.Console/

    Nem tud odamenni? Azt látom, hogy root-ként próbáltad eddig. Ezt is root-ként próbálod?

    igen tehát ssh-ba root belépés cd mappa és dotnet run és megy...

    • klt válaszolt erre.

      mennydorges
      /opt/Pfire/src/Pfire.Console
      versus:
      /opt/PFire/src/PFire.Console/

      Melyik az igazi?

      Akkor nyilván a szkriptbe is az igazit kell írni 😉
      Én csak kopi-pasztáztam, szóval mosom kezeimet...

        klt de hogy is nehogy félre érts. Nem mondok ilyet. Este van majd holnap tuszta fejjel átnézem de már a kislány kezdi félórája az esti rinyát... hajnalig nem kell aludni tőle. Jó éjt és köszönöm szépen.

        klt
        Na picit előre.:
        Bemásoltam az sh file-t a
        /opt/PFire/src/PFire.Console/ -ba ott ha így meghívom:
        sh xfirestart.sh
        Szépen elindul.
        De service-ben még mindig nem akarja....

        • klt válaszolt erre.

          mennydorges Mindegy, hogy hol a szkript.

          Próbáljunk meg valamit (ez nem a megoldás, csak egy teszt):

          #!/bin/sh
          pwd
          cd /opt/PFire/src/PFire.Console
          pwd

          Ez mit ír ki, ha futtatod?

          : not foundsh: 2: xfirestart.sh: pwd
          xfirestart.sh: 3: cd: can't cd to /

          De ez vicc hallod.. komolyan.

          sudo chmod o+x bedobtam ezt is neki és ugyanaz.

          • klt válaszolt erre.

            mennydorges A pwd nincs a path-ban???
            Fura...

            Akkor így:

            
            #!/bin/sh
            /usr/bin/pwd
            cd /opt/PFire/src/PFire.Console
            /usr/bin/pwd
            /bin/pwd
            #!/bin/sh
            /bin/pwd
            cd /opt/PFire/src/PFire.Console
            /bin/pwd
            : not foundsh: 2: xfirestart.sh: /bin/pwd
            xfirestart.sh: 3: cd: can't cd to /opt/PFire/src/PFire.Console
            • klt válaszolt erre.

              mennydorges Akkor azt írd oda!
              És nézzük meg hol akad el:

              
              #!/bin/sh
              /bin/pwd
              cd /opt
              /bin/pwd
              cd PFire
              /bin/pwd
              cd src
              /bin/pwd
              cd PFire.Console
              /bin/pwd
              /bin/whoami

              (Remélem, a whoami is ott van...)

              sh xfirestart.sh
              : not foundsh: 2: xfirestart.sh: /bin/pwd
              xfirestart.sh: 3: cd: can't cd to /opt
              : not foundsh: 4: xfirestart.sh: /bin/pwd
              xfirestart.sh: 5: cd: can't cd to PFire
              : not foundsh: 6: xfirestart.sh: /bin/pwd
              xfirestart.sh: 7: cd: can't cd to src
              : not foundsh: 8: xfirestart.sh: /bin/pwd
              xfirestart.sh: 9: cd: can't cd to PFire.Console
              : not foundsh: 10: xfirestart.sh: /bin/pwd
              xfirestart.sh: 11: xfirestart.sh: /bin/whoami: not found
              • klt válaszolt erre.

                tr -d "\r" < réginév.sh > újnév.sh Eltávolítottam.
                Most már nem csak sh xfire.sh ként indul
                hanem ./xfire.sh is most megpróbálom a service-t.

                • klt válaszolt erre.

                  mennydorges
                  Az előbb mondta a which, hogy a pwd a /bin -ben van (/bin/pwd).
                  Most meg not found.
                  Csak egy lehetséges magyarázatot tudok elképzelni.
                  Lehetséges, hogy Windows alatt szerkeszted a szkriptet?
                  Ha igen, akkor legyél szíves Linux alatt művelni, vagy a Windowson olyan programot használni, ami tud Linux-os sor vége jeleket alkalmazni, és abe is állítod olyanra!

                    klt
                    Na alakul most a service erre jutott:

                    systemctl status xfirepfire
                    ● xfirepfire.service - Xfire szerver
                       Loaded: loaded (/etc/systemd/system/xfirepfire.service; enabled; vendor preset: enabled)
                       Active: failed (Result: exit-code) since Tue 2023-05-02 10:29:04 CEST; 45s ago
                      Process: 10498 ExecStart=/root/src/PFireConsole/xfire.sh (code=exited, status=1/FAILURE)
                     Main PID: 10498 (code=exited, status=1/FAILURE)
                    
                    máj 02 10:29:03 panel systemd[1]: Started Xfire szerver.
                    máj 02 10:29:04 panel xfire.sh[10498]: Couldn't find a project to run. Ensure a project exists in /, or pass the path to the project using --project.
                    máj 02 10:29:04 panel systemd[1]: xfirepfire.service: Main process exited, code=exited, status=1/FAILURE
                    máj 02 10:29:04 panel systemd[1]: xfirepfire.service: Failed with result 'exit-code'.
                    • klt válaszolt erre.