Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:guides:installation:linux [2018/02/20 00:22]
irgendwer added docker instructions
en:guides:installation:linux [2018/11/10 04:18] (current)
Patschi systemctl start
Line 6: Line 6:
  
  apt-get update  apt-get update
- apt-get install x11vnc xvfb libxcursor1 ca-certificates bzip2 libnss3 libegl1-mesa x11-xkb-utils libasound2 ​-y+ apt-get install ​-y x11vnc xvfb libxcursor1 ca-certificates bzip2 libnss3 libegl1-mesa x11-xkb-utils libasound2
  update-ca-certificates  update-ca-certificates
  
Line 13: Line 13:
  apt-get install libglib2.0-0  apt-get install libglib2.0-0
  
-Let's assume that you're going to install ​the bot to `/​opt/​sinusbot` and are using the user `sinusbotwith the group `sinusbot`. We will install the bot with root then switch to this user account when running the bot.+**In case of Ubuntu 18.04**: Depending on the Ubuntu installation ​the `universerepository of Ubuntu is not activated, resulting in missing packages for required dependencies *x11vnc* ​and *xvfb*. When said problem ocurrs, enable ​the `universerepository by using following command:
  
-You will need to add the user sinusbot to your server, so to do so type the following command.+ add-apt-repository universe 
 + apt-get update
  
- adduser ​sinusbot+After all required dependencies are installed, let's assume that you're going to install the bot to `/opt/sinusbot` and are using the user `sinusbot` with the group `sinusbot`. We will install the bot with root then switch to this user account when running the bot.
  
-You will then be prompted ​to set a password for the account, do that and then simply press enter when it asks you for the name etc.+You will need to create an new user `sinusbot` on your serverso to do so type the following command.
  
-Now you will need to install the bot to the server.+ adduser --disabled-login sinusbot
  
- mkdir -p /​opt/​sinusbot+This created user is used to start the bot with usual user privileges (which is highly recommended!),​ as the bot should **not** run as root for security-reasons. 
 + 
 +Next we will create and prepare the folder where Sinusbot will be installed to, by issuing following commands as the root user: 
 + 
 + mkdir -p /opt/sinusbot # create folder 
 + chown -R sinusbot:​sinusbot /​opt/​sinusbot # grant sinusbot user permissions on specified folder 
 + 
 +(If you're using another user/group than "​sinusbot",​ replace sinusbot:​sinusbot with **yourusername:​yourusergroup**) 
 + 
 +Then we will switch over to the recently created user dedicated for the sinusbot, change the working directory and to download the latest Sinusbot release: 
 + 
 + su sinusbot
  cd /​opt/​sinusbot  cd /​opt/​sinusbot
  wget https://​www.sinusbot.com/​dl/​sinusbot.current.tar.bz2  wget https://​www.sinusbot.com/​dl/​sinusbot.current.tar.bz2
Line 38: Line 50:
  
  cp config.ini.dist config.ini  cp config.ini.dist config.ini
- 
-If you're running the bot under another user than root (and that's highly recommended),​ you need to change the ownership of the bot directory to that user now. 
- 
- chown -R sinusbot:​sinusbot /​opt/​sinusbot 
- 
-(If you're using another user/group than "​sinusbot",​ replace sinusbot:​sinusbot with **yourusername:​yourusergroup**) 
  
 Now you need to download the TeamSpeak 3 Client and **install it**. Now you need to download the TeamSpeak 3 Client and **install it**.
  
- wget http://​dl.4players.de/​ts/​releases/​3.1.8/​TeamSpeak3-Client-linux_amd64-3.1.8.run + wget http://​dl.4players.de/​ts/​releases/​3.2.2/​TeamSpeak3-Client-linux_amd64-3.2.2.run 
- chmod 0755 TeamSpeak3-Client-linux_amd64-3.1.8.run + chmod 0755 TeamSpeak3-Client-linux_amd64-3.2.2.run 
- ./​TeamSpeak3-Client-linux_amd64-3.1.8.run+ ./​TeamSpeak3-Client-linux_amd64-3.2.2.run
  
 You will need to accept the terms. You will need to accept the terms.
Line 81: Line 87:
  
 ## Update ## Update
 +
 +(This instructions needs to be done using the sinusbot user.)
  
 Make sure you're using the latest version: Make sure you're using the latest version:
Line 137: Line 145:
 ## Using a startscript ## Using a startscript
  
-create ​a file at /​etc/​systemd/​system/​sinusbot.service with the following content:+(This instructions needs to be done using the `root` user.) ​  
 +Create ​a file at `/​etc/​systemd/​system/​sinusbot.servicewith the following content: 
 ``` ```
 [Unit] [Unit]
 Description=Sinusbot,​ the Teamspeak 3 and Discord music bot. Description=Sinusbot,​ the Teamspeak 3 and Discord music bot.
-After=syslog.target network.target+Wants=network-online.target 
 +After=syslog.target network.target network-online.target
  
 [Service] [Service]
Line 152: Line 163:
 KillSignal=2 KillSignal=2
 SendSIGKILL=yes SendSIGKILL=yes
 +Environment=QT_XCB_GL_INTEGRATION=none
 +LimitNOFILE=512000
 +LimitNPROC=512000
  
 [Install] [Install]
Line 159: Line 173:
 Adjust the following placeholders to your installation:​ Adjust the following placeholders to your installation:​
  
 +^ placeholder ​                     ^ description ​                                ^ example ​               ^
 | YOUR\_USER ​                      | Your user who starts the bot                | sinusbot ​              | | YOUR\_USER ​                      | Your user who starts the bot                | sinusbot ​              |
 | YOUR\_PATH\_TO\_THE\_BOT\_BINARY | Your path to the SinusBot binary ​           | /​opt/​sinusbot/​sinusbot | | YOUR\_PATH\_TO\_THE\_BOT\_BINARY | Your path to the SinusBot binary ​           | /​opt/​sinusbot/​sinusbot |
-YOU\_PATH\_TO\_THE\_BOT ​         | Your path to the SinusBot install directory | /​opt/​sinusbot ​         |+YOUR\_PATH\_TO\_THE\_BOT ​         | Your path to the SinusBot install directory | /​opt/​sinusbot ​         | 
 + 
 +Reload systemd: `systemctl daemon-reload`
  
-Reload systemd ​`systemctl ​daemon-reload`+Enable autostart (optional): ​`systemctl ​enable sinusbot`
  
-Start the sinusbot `service sinusbot ​start`+Start the sinusbot`systemctl ​start sinusbot`
  
 +----
  
 +//​[github.com/​SinusBot/​linux-startscript](https://​github.com/​SinusBot/​linux-startscript)//​