Nagyon nem csináltam még netframeworkos progit...

  • klt válaszolt erre.

    mennydorges

    mennydorges Próbálom működésre bírni.

    Mutattam linket, ami elmegyarázza, mi az a #! kezdetű izé a szkript elején. Azt nem nézted meg?

    It's called a shebang, and tells the parent shell which interpreter should be used to execute the script.

    mennydorges Nagyon nem csináltam még

    Én se. De ha terminálból elindul, akkor így is el kéne neki.

      klt Vágesz volt annó valami hasonló ondom service-ben és valami tök egyszerű kis pici hiba volt csak nem jut eszembe.

      • klt válaszolt erre.

        mennydorges Na, hát ezt kell végignézni. Terminálból elindul a szkripttel? Ha igen, a .service fájlban van a bibi. Ha nem, akkor meg amott.
        Nálam előfordul, hogy elgépelem valaminek a nevét, kihagyok betűt, vagy felcserélek véletlenül két betűt egy névben. Ez utóbbit veszem észre legnehezebben.
        Service fájlban a /./ fölösleges, elég a /
        A shellben viszont tényleg kell a ./, ha az aktuális könyvtárban indítasz valamit, viszont nem kell, ha teljes útvonalát adod meg, például /usr/bin/ping.

        ./xfirestart.sh
        -bash: ./xfirestart.sh: /bin/shM: rossz parancsértelmező: A szövegfájl foglalt

        • klt válaszolt erre.

          sh xfirestart.sh
          xfirestart.sh: 2: xfirestart.sh: /opt/PFire/src/PFire.Console/dotnet: not found
          Valszeg ebben van neki a nem tetszik rész:

          /opt/PFire/src/PFire.Console/dotnet run

          Nem értelmezi....

          • klt válaszolt erre.

            klt

            Ennyi a terminálban az indítás:

            cd /opt/PFire/src/PFire.Console/

            dotnet run

            Módosítottam az sh file-t:
            #!/bin/sh
            /usr/bin/dotnet /opt/PFire/src/PFire.Console/dotnet run

            Most erre lázad:

            sh xfirestart.sh
            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-/opt/PFire/src/PFire.Console/PFire.Console.csproj
            • You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
            • klt válaszolt erre.

              mennydorges
              Azt írd a szkriptbe, ahogy terminálból indulna:

              #!/bin/sh
              cd /opt/PFire/src/PFire.Console
              dotnet run

                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.