You are not logged in.

#26 2021-07-12 11:15:48

Welt
Member
Registered: 2020-09-04
Posts: 66

Re: Starting .sh files on the startup

loqs wrote:
seth wrote:

Instead of useless vague descriptions of the status quo, you should describe the actual status quo.
* what scripts - which one runs, which one doesn't?
* what are their permissions, notably: are they executable?
* how do you currently run them - are there entries in the XDG autostart paths?

You did not cover the second and third point.
Please also post the journal output for the failing service you replaced with a script.

I covered them before. Yes they are executable im autostarting them from the settings menu of kde plasma DE. Hamachi's script auto starts perfectly and runs smoothly but my server launching script isn't auto starting but runs perfectly fine it is executable. Im trying to autostart both of them in the same way.


seth wrote:

And if you want to understand why or not the scripts keep the terminal open: post the actual scripts…

Oh sorry i didn't mentioned that part. I don't have any problems with keeping terminal open or not both scripts running perfectly as intended.


Currently i have just one issue that issue is: I can't autostart my server launching script. Hamachi auto starts but server launching one isn't. Im both trying to auto start them from settings of KDE plasma DE.

Last edited by Welt (2021-07-12 11:21:02)

Offline

#27 2021-07-12 12:56:50

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,501
Website

Re: Starting .sh files on the startup

Welt wrote:

Currently i have just one issue...

And everyone trying to help you has just one issue, the fact that you seem determined to evade or ignore requests for information.

Do not expect anyone to even bother trying to help if you keep that up.

Post the actual permissions (e.g., output of `stat /path/to/script`), and post the actual scripts.

Last edited by Trilby (2021-07-12 12:57:27)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#28 2021-07-12 13:36:13

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,432

Re: Starting .sh files on the startup

I can't autostart my server launching script

And did you add a desktop service for it to the xdg autostart path? What does that look like?
If not, why not?
If yes, we're back to the files permissions and content as to why it still might fail…

We're now 28 posts in - without you getting more specific this thread will go nowhere. Ever.

Offline

#29 2021-07-12 17:31:35

Welt
Member
Registered: 2020-09-04
Posts: 66

Re: Starting .sh files on the startup

Trilby wrote:
Welt wrote:

Currently i have just one issue...

And everyone trying to help you has just one issue, the fact that you seem determined to evade or ignore requests for information.

Do not expect anyone to even bother trying to help if you keep that up.

Post the actual permissions (e.g., output of `stat /path/to/script`), and post the actual scripts.

Output of the stat of the script:

  File: /home/supflynn/Desktop/the-1122-pack_1.3.5/LaunchServer.sh
  Size: 124             Blocks: 8          IO Block: 4096   regular file
Device: 803h/2051d      Inode: 35915621    Links: 1
Access: (0755/-rwxr-xr-x)  Uid: ( 1000/supflynn)   Gid: ( 1000/supflynn)
Access: 2021-07-12 20:12:35.495454439 +0300
Modify: 2021-07-11 12:52:30.935982611 +0300
Change: 2021-07-12 20:00:05.836999587 +0300
 Birth: 2021-07-08 14:48:46.539148589 +0300

Failing script :

#!/bin/bash
konsole -e java -server -Xmx14G -Dfml.queryResult=confirm -Duser.language=en -jar forge-1.12.2-14.23.5.2855.jar

-Xmx for ram usage, -Duser.language=en for world generating/loading for not failing chunks, -Dfml.queryResult for checking servers state after full start-up of the server.

Successful script :

#!/bin/bash
sudo systemctl start logmein-hamachi

Last edited by Welt (2021-07-12 18:06:26)

Offline

#30 2021-07-12 18:29:12

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,501
Website

Re: Starting .sh files on the startup

Thanks.  Neither of those need to be scripts - especially if they are launched from .desktop files.  Just put the command in the desktop file's Exec line.  And as already noted quite a few posts past, if this is being launched from a .desktop file, you should use ther Terminal=true setting instead of launching Konsole from the script.

But for the issue of the failing script, how does it fail?  Have you tried redirecting stdout/stderr to a file to check what's happening?  I'd not be surprised if this was a java-related issue due to the script not running from a log-in shell (and perhaps then not having the java-related content of /etc/profile.d sourced).

If these are launched via .desktop files, please post those as well.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#31 2021-07-12 18:38:17

Welt
Member
Registered: 2020-09-04
Posts: 66

Re: Starting .sh files on the startup

Trilby wrote:

Thanks.  Neither of those need to be scripts - especially if they are launched from .desktop files.  Just put the command in the desktop file's Exec line.  And as already noted quite a few posts past, if this is being launched from a .desktop file, you should use ther Terminal=true setting instead of launching Konsole from the script.

But for the issue of the failing script, how does it fail?  Have you tried redirecting stdout/stderr to a file to check what's happening?  I'd not be surprised if this was a java-related issue due to the script not running from a log-in shell (and perhaps then not having the java-related content of /etc/profile.d sourced).

If these are launched via .desktop files, please post those as well.

I searched

Just put the command in the desktop file's Exec line 

but everyone talks about .desktop files  which file is it ?

seth wrote:

I can't autostart my server launching script

And did you add a desktop service for it to the xdg autostart path? What does that look like?
If not, why not?
If yes, we're back to the files permissions and content as to why it still might fail…

We're now 28 posts in - without you getting more specific this thread will go nowhere. Ever.

I didn't did even one of those because .desktop file breaks server itself. I added scripts to autostart part of KDE plasma's autosart section in settings tab.

Last edited by Welt (2021-07-12 18:41:06)

Offline

#32 2021-07-12 19:00:05

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,432

Re: Starting .sh files on the startup

but everyone talks about .desktop files  which file is it ?

because .desktop file breaks server itself. I added scripts to autostart part of KDE plasma's autosart section

This doesn't add up.

everyone talks about .desktop files  which file is it ?

https://bbs.archlinux.org/viewtopic.php … 4#p1982174

If not this way, how exactly *do* you try to run the failing script?
Chances are it "fails" because you're not running it out of the X11 session, so konsole doesn't find a $DISPLAY and bails.

Offline

#33 2021-07-12 19:25:07

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,501
Website

Re: Starting .sh files on the startup

You provided the full path to the script.  It is not in ~/.config/autostart-scripts/.  Therefore you'd have to start it with a .desktop file.  How / Why exactly do you expect this script to autostart?  What have you actually and precisely done to set it to autostart?

(I can't believe we 33 posts in and none of us yet have any idea what has been attempted)

Last edited by Trilby (2021-07-12 19:25:51)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#34 2021-07-12 19:52:31

snakeroot
Member
Registered: 2012-10-06
Posts: 177

Re: Starting .sh files on the startup

Welt wrote:

I added scripts to autostart part of KDE plasma's autosart section in settings tab.

Per the KDE documentation and the Arch Wiki, there seem to be two different ways to do this.

You can click on "Add Application…" which will then, per the Wiki, generate a .desktop file.

You can click on "Add Login Script…" which will then, per the Wiki, create a symlink to the script.

Which of these did you do?

Offline

#35 2021-07-12 20:55:57

Welt
Member
Registered: 2020-09-04
Posts: 66

Re: Starting .sh files on the startup

seth wrote:

but everyone talks about .desktop files  which file is it ?

because .desktop file breaks server itself. I added scripts to autostart part of KDE plasma's autosart section

This doesn't add up.

everyone talks about .desktop files  which file is it ?

https://bbs.archlinux.org/viewtopic.php … 4#p1982174

If not this way, how exactly *do* you try to run the failing script?
Chances are it "fails" because you're not running it out of the X11 session, so konsole doesn't find a $DISPLAY and bails.

I didn't meant that i meant after i searched about exec file on the google everyone talks about .desktop files what's exec files location.

snakeroot wrote:
Welt wrote:

I added scripts to autostart part of KDE plasma's autosart section in settings tab.

Per the KDE documentation and the Arch Wiki, there seem to be two different ways to do this.

You can click on "Add Application…" which will then, per the Wiki, generate a .desktop file.

You can click on "Add Login Script…" which will then, per the Wiki, create a symlink to the script.

Which of these did you do?

I did add login script and added that two scripts.

Trilby wrote:

You provided the full path to the script.  It is not in ~/.config/autostart-scripts/.  Therefore you'd have to start it with a .desktop file.  How / Why exactly do you expect this script to autostart?  What have you actually and precisely done to set it to autostart?

(I can't believe we 33 posts in and none of us yet have any idea what has been attempted)

I said it before but let me say it again i added two of the scripts to KDE Plasma's autostart section via system settings menu.
https://wiki.archlinux.org/title/KDE#Autostart
First line

Plasma can autostart applications and run scripts on startup and shutdown. To autostart an application, navigate to System Settings > Startup and Shutdown > Autostart and add the program or shell script of your choice.

this is what i did. To be more percise. Which actually does creating a symlink of the script automaticly. According to the 2nd line

For applications, a .desktop file will be created, for shell scripts, a symlink will be created.

So actually after this explanation you don't even need to open the link cuz i pasted everything here xD.

Last edited by Welt (2021-07-12 21:06:09)

Offline

#36 2021-07-12 21:07:26

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,432

Re: Starting .sh files on the startup

konsole -e java -server -Xmx14G -Dfml.queryResult=confirm -Duser.language=en -jar forge-1.12.2-14.23.5.2855.jar

This will then fail because forge-1.12.2-14.23.5.2855.jar isn't in the PWD of the symlinked executable

Offline

#37 2021-07-12 21:09:14

Welt
Member
Registered: 2020-09-04
Posts: 66

Re: Starting .sh files on the startup

seth wrote:

konsole -e java -server -Xmx14G -Dfml.queryResult=confirm -Duser.language=en -jar forge-1.12.2-14.23.5.2855.jar

This will then fail because forge-1.12.2-14.23.5.2855.jar isn't in the PWD of the symlinked executable

Can you explain that a bit cuz i didn't understand anything from that. So i should create a .desktop file manually but it breaks my server itself. Seems like PWD is just something like printf in coding.

Last edited by Welt (2021-07-12 21:11:49)

Offline

#38 2021-07-12 21:14:06

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,432

Re: Starting .sh files on the startup

So i should create a .desktop file manually but it breaks my server itself.

"Can you explain that a bit cuz i didn't understand anything from that."

Either way, the script isn't very robust and will only work when exuted from the path where forge-1.12.2-14.23.5.2855.jar resides.
Reference the file by its absolute path.

Edit:

echo $PWD

How the fuck did you manage to install … – I better don't ask…

Last edited by seth (2021-07-12 21:15:27)

Offline

#39 2021-07-12 21:32:50

Welt
Member
Registered: 2020-09-04
Posts: 66

Re: Starting .sh files on the startup

seth wrote:

So i should create a .desktop file manually but it breaks my server itself.

"Can you explain that a bit cuz i didn't understand anything from that."

Either way, the script isn't very robust and will only work when exuted from the path where forge-1.12.2-14.23.5.2855.jar resides.
Reference the file by its absolute path.

Edit:

echo $PWD

How the fuck did you manage to install … – I better don't ask…

Wiki absolutly. And executable script and forge-1.12.2-14.23.5.2855.jar in the same folder.

Absolute paths:

/home/supflynn/Desktop/the-1122-pack_1.3.5/LaunchServer.sh
/home/supflynn/Desktop/the-1122-pack_1.3.5/forge-1.12.2-14.23.5.2855.jar

By the way till here thanks for determineness seth i can see how tilted you are towards me but you still keep trying to help that should be awarded some way. And all others which helped me so far thanks a lot espacially trilby helped me a lot before now and then he helped me a lot in the past too and he still is. I'm trying my best guys thanks for your determined personalties.

Last edited by Welt (2021-07-12 21:37:30)

Offline

#40 2021-07-12 21:57:44

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,501
Website

Re: Starting .sh files on the startup

Welt wrote:

And executable script and forge-1.12.2-14.23.5.2855.jar in the same folder.

But the symlinks are in a different directory.  That's the symlink created by the gui tool you used that obscures from you what is actually happening.  But in either case, put the full absolute path to the jar file in the script and it should work.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB