Jump to content

I want to make a startup script for my servers running arch linux

5 minutes ago, Lemon797 said:

I didn't use the arch linux minecraft package or know it was a thing....

If you have any problem with Arch Linux always check the wiki first. All I did was open it and type "minecraft" in the search box.

8 minutes ago, kelvinhall05 said:

OP is running a Paper server which iirc does not create a systemd service when run for the first time. It has to be started and run with java.

In that case OP can make their own systemd unit https://wiki.archlinux.org/index.php/Systemd#Writing_unit_files

 

It's just a single command so it shouldn't be a problem.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

12 minutes ago, kelvinhall05 said:

Why all those arguements? iirc you should be able to just run


lxterminal -e /path/to/update.sh

 

What file do I put this in?

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Lemon797 said:

What file do I put this in?

You make the systemd unit that runs this.

Quote me to see my reply!

SPECS:

CPU: Ryzen 7 3700X Motherboard: MSI B450-A Pro Max RAM: 32GB I forget GPU: MSI Vega 56 Storage: 256GB NVMe boot, 512GB Samsung 850 Pro, 1TB WD Blue SSD, 1TB WD Blue HDD PSU: Inwin P85 850w Case: Fractal Design Define C Cooling: Stock for CPU, be quiet! case fans, Morpheus Vega w/ be quiet! Pure Wings 2 for GPU Monitor: 3x Thinkvision P24Q on a Steelcase Eyesite triple monitor stand Mouse: Logitech MX Master 3 Keyboard: Focus FK-9000 (heavily modded) Mousepad: Aliexpress cat special Headphones:  Sennheiser HD598SE and Sony Linkbuds

 

🏳️‍🌈

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, Lemon797 said:

I would like to make a startup script that does these things:

1. auto login

2. starts the GUI(LXDE)

3. opens all the terminal tabs I need

4. starts my vnc (tigervnc) in one of those terminals

5. starts my minecraft servers in those terminals

6. maybe auto update?

7. moves all the tabs to the position that I need them in.

I'm going to be the one too say, please, please just learn how to actually use the CLI why does your server even have a gui?? CLI is so much more flexible

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, GougedKirby522 said:

I'm going to be the one too say, please, please just learn how to actually use the CLI why does your server even have a gui?? CLI is so much more flexible

I do know how to use the cli, but I use the gui because I can have everything open on ONE screen

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, Sauron said:
Quote

~/.config/systemd/user/x0vncserver.service

[Unit]
Description=Remote desktop service (VNC)

[Service]
Type=simple
# wait for Xorg started by ${USER}
ExecStartPre=/bin/sh -c 'while ! pgrep -U "$USER" Xorg; do sleep 2; done'
ExecStart=/usr/bin/x0vncserver -rfbauth %h/.vnc/passwd
# or login with your username & password
#ExecStart=/usr/bin/x0vncserver -PAMService=login -PlainUsers=${USER} -SecurityTypes=TLSPlain

[Install]
WantedBy=default.target

can I delete the part where it waits for xorg to be started, so that it turns on boot? Also do I edit the "ExecStart=/usr/bin/x0vncserver -rfbauth %h/.vnc/passwd" part to run the startup command that I use?

Link to comment
Share on other sites

Link to post
Share on other sites

16 minutes ago, Lemon797 said:

can I delete the part where it waits for xorg to be started, so that it turns on boot?

I think so but you'll have to try it out to be sure

16 minutes ago, Lemon797 said:

Also do I edit the "ExecStart=/usr/bin/x0vncserver -rfbauth %h/.vnc/passwd" part to run the startup command that I use?

Yes

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Sauron said:

I think so but you'll have to try it out to be sure

Yes

ok. Completely off topic but there is an ip addr showing up on the vnc's cli that keeps trying to connect. I've found a command for my router that will block an ip addr, but it needs the subnet and I don't know the subnet of the ip trying to connect. is there a way to find it?

Link to comment
Share on other sites

Link to post
Share on other sites

30 minutes ago, Lemon797 said:

ok. Completely off topic but there is an ip addr showing up on the vnc's cli that keeps trying to connect. I've found a command for my router that will block an ip addr, but it needs the subnet and I don't know the subnet of the ip trying to connect. is there a way to find it?

what address?

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Lemon797 said:

185.56.80.222

Subnets generally refer to local addresses... this is an external address. Are you sure the router function does what you think it does?

 

Also for this sort of thing you should probably use a firewall and either way VNC is not safe to expose outside your network; you should either use ssh tunneling or use a different remote desktop system like x2go.

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

20 minutes ago, Sauron said:

Subnets generally refer to local addresses... this is an external address. Are you sure the router function does what you think it does?

 

Also for this sort of thing you should probably use a firewall and either way VNC is not safe to expose outside your network; you should either use ssh tunneling or use a different remote desktop system like x2go.

I looked up the ip and got this: https://www.abuseipdb.com/check/185.56.80.222

and the way I was trying to block it didn’t work.

Link to comment
Share on other sites

Link to post
Share on other sites

7 hours ago, Lemon797 said:

do I use root or the user for this?

do you want to login as root with vnc?

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, Sauron said:

do you want to login as root with vnc?

no. I got the vnc script. just testing now hope it works!

Link to comment
Share on other sites

Link to post
Share on other sites

On 9/20/2020 at 7:02 AM, Lemon797 said:

I would like to make a startup script that does these things:

1. auto login

2. starts the GUI(LXDE)

What dispaly manager are you using? I assumed lxdm in your last thread and pointed you to the WiKi.

 

On 9/20/2020 at 7:02 AM, Lemon797 said:

. opens all the terminal tabs I need

If your running everything through the terminal, why not use OpenSSH instead?

 

On 9/20/2020 at 7:02 AM, Lemon797 said:

4. starts my vnc (tigervnc) in one of those terminals

You can start it using ~/.xprofile or a systemd service, it doesn't need to be open in a terminal.

 

On 9/20/2020 at 7:02 AM, Lemon797 said:

5. starts my minecraft servers in those terminals

How are you starting them now, I actually don't know how to run more than one instance on the same machine, though I know you can. The information however would help.

 

On 9/20/2020 at 7:02 AM, Lemon797 said:

6. maybe auto update?

As someone who runs a Arch Server, I would really advise against that. Really I should probably advise against running a Arch server in general, I have been looking at moving to Fedora or CentOS for our server instances personally. It's not uncommon for Server packages to need manual intervention. Even if your just running a Minecraft Server, you would be better off updating when you are actually around to fix it if something goes wrong.

 

On 9/20/2020 at 7:02 AM, Lemon797 said:

7. moves all the tabs to the position that I need them in.

While I am sure this is possible, I have no idea what terminal you would need to accomplish this.

 

19 hours ago, Lemon797 said:

can I delete the part where it waits for xorg to be started, so that it turns on boot? Also do I edit the "ExecStart=/usr/bin/x0vncserver -rfbauth %h/.vnc/passwd" part to run the startup command that I use?

You can remove it, but it wont start if a user X session is not already started, x0vncserver runs on the current running X Display. So there is really no reason to remove it. If anything you might cause the Service to fail. You can replace "ExecStart" with whatever you want, so long as this gets executed somewhere at some point "/usr/bin/x0vncserver -rfbauth %h/.vnc/passwd"

 

13 hours ago, Lemon797 said:

do I use root or the user for this?

It's a user service which is activated with "systemctl enable --user x0vncserver", So you would create it in under whatever user you plan to have login.

The service won't be activated until that user logs in.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Nayr438 said:

What dispaly manager are you using? I assumed lxdm in your last thread and pointed you to the WiKi.

I don't currently use one, but I am trying to get ldm. The autologin for ldm isn't working.

1 hour ago, Nayr438 said:

You can start it using ~/.xprofile or a systemd service, it doesn't need to be open in a terminal.

I got a systemd service that does this, but because of the auto login not working I don't know if it works or not.

1 hour ago, Nayr438 said:

How are you starting them now, I actually don't know how to run more than one instance on the same machine, though I know you can. The information however would help.

I think I can just make a systemd service that does ExecStart=/usr/bin/lxterminal -e /path/to/update.sh (update.sh is the script I use to update the papermc version)

1 hour ago, Nayr438 said:

As someone who runs a Arch Server, I would really advise against that. Really I should probably advise against running a Arch server in general, I have been looking at moving to Fedora or CentOS for our server instances personally. It's not uncommon for Server packages to need manual intervention. Even if your just running a Minecraft Server, you would be better off updating when you are actually around to fix it if something goes wrong.

Ok, lots of other people have said no auto updates as well.

1 hour ago, Nayr438 said:

While I am sure this is possible, I have no idea what terminal you would need to accomplish this.

I didn't think it was posible. that's cool.

1 hour ago, Nayr438 said:

You can remove it, but it wont start if a user X session is not already started, x0vncserver runs on the current running X Display. So there is really no reason to remove it. If anything you might cause the Service to fail. You can replace "ExecStart" with whatever you want, so long as this gets executed somewhere at some point "/usr/bin/x0vncserver -rfbauth %h/.vnc/passwd"

 

It's a user service which is activated with "systemctl enable --user x0vncserver", So you would create it in under whatever user you plan to have login.

The service won't be activated until that user logs in.

I think a got these.

Link to comment
Share on other sites

Link to post
Share on other sites

17 minutes ago, Lemon797 said:

I don't currently use one, but I am trying to get ldm. The autologin for ldm isn't working.

How are you starting your session currently?

Link to comment
Share on other sites

Link to post
Share on other sites

6 hours ago, Nayr438 said:

How are you starting your session currently?

i'm using startx

Link to comment
Share on other sites

Link to post
Share on other sites

7 hours ago, Nayr438 said:

How are you starting your session currently?

Do you know why the autologin isn't working??

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Lemon797 said:

Do you know why the autologin isn't working??

When you say LDM, do you mean LigthDM?

Did you follow everything listed here, https://wiki.archlinux.org/index.php/LightDM#Enabling_autologin

Did you enable lightdm? systemctl enable lightdm

If your using "~/.xinitrc" for startx, did you delete the file?

 

What exactly is it doing? saying autlogin isn't working, doesn't really mean much.

Link to comment
Share on other sites

Link to post
Share on other sites

8 minutes ago, Nayr438 said:

When you say LDM, do you mean LigthDM?

Did you follow everything listed here, https://wiki.archlinux.org/index.php/LightDM#Enabling_autologin

Did you enable lightdm? systemctl enable lightdm

If your using "~/.xinitrc" for startx, did you delete the file?

 

What exactly is it doing? saying autlogin isn't working, doesn't really mean much.

I did not delete the ~/.xinitrc file.

It's going to the lightdm gui and prompting login.

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, Lemon797 said:

I did not delete the ~/.xinitrc file.

It's going to the lightdm gui and prompting login.

I just deleted the .xinitrc and it still does the same thing.

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Lemon797 said:

I just deleted the .xinitrc and it still does the same thing.

did you create the autologin group and add the user?

did you edit "/etc/lightdm/lightdm.conf" and set the user and session?

[Seat:*]
autologin-user=username
autologin-session=LXDE

 

Link to comment
Share on other sites

Link to post
Share on other sites

3 hours ago, Nayr438 said:

did you create the autologin group and add the user?

did you edit "/etc/lightdm/lightdm.conf" and set the user and session?


[Seat:*]
autologin-user=username
autologin-session=LXDE

 

Yes I did that.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×