Running O11 as service using systemd

Setting Up a Systemd Service for Your Application

This guide explains how to create a startup script and configure a systemd service to ensure your application starts automatically when the server boots.

1. Prepare the Startup Script (start.sh)

1.1 Create the start.sh Script

  1. Log in to your server.
  2. Navigate to the directory where you want to create the script (e.g., /opt/o11):
    cd /opt/o11
    
  3. Create and edit the start.sh file:
    sudo nano start.sh
    
  4. Add the following content to start.sh (adjust the paths and options based on your application’s requirements):
    #!/bin/bash
    
    # Command to start your application
    # Replace this with your application's specific command
    /home/o11/start -p 9200 -allow 127.0.0.1
    
  5. Save and close the editor (Ctrl+X, then Y, then Enter in nano).
  6. Make the script executable:
    sudo chmod +x start.sh
    

2. Create the Systemd Service File

2.1 Create the Service File

  1. Open a text editor to create the service file:
    sudo nano /etc/systemd/system/o11.service
    
  2. Add the following content to the file:
    [Unit]
    Description=o11 Service
    After=network.target
    
    [Service]
    Type=simple
    ExecStart=/opt/o11/start.sh
    WorkingDirectory=/opt/o11
    Restart=always
    RestartSec=3
    
    [Install]
    WantedBy=multi-user.target
    
  3. Save and close the editor (Ctrl+X, then Y, then Enter in nano).

2.2 Reload Systemd Configurations

Reload the systemd configuration to recognize the new service:

sudo systemctl daemon-reload

2.3 Enable and Start the Service

  1. Enable the service to start automatically at boot:
    sudo systemctl enable o11.service
    
  2. Start the service immediately:
    sudo systemctl start o11.service
    

2.4 Check the Service Status

Verify that the service is running:

sudo systemctl status o11.service

If there are errors, check the logs:

journalctl -u o11.service

3. Restart the Server

  1. Restart the server to verify that the service starts automatically:
    sudo reboot
    
  2. After the reboot, check the service status:
    sudo systemctl status o11.service
    

This setup ensures your application is configured to start automatically using systemd. :rocket:

2 Likes

this scrpt not work on o11 v3 after reboot not work plz how to work on v3 o11 help me thank u

sudo nano /etc/systemd/system/o11.service

[Unit]
Description=o11 Service
After=network.target

[Service]
Type=simple
User=root
Group=root
WorkingDirectory=/root/o11
ExecStart=/root/o11/o11_launcher -p 6060 -noramfs
KillMode=control-group
Restart=on-failure
RestartSec=3
TasksMax=infinity
LimitNOFILE=infinity
LimitNPROC=infinity

[Install]
WantedBy=multi-user.target graphical.target

systemctl enable o11.service

1 Like

no ramfs issue when you don’t mount ram disk while using ffmpeg. i recommend using internal muxer for better results

2 Likes

Thank You brother work fine

1 Like

any chance to run it as non-root process?

it had to root process

Does anyone know how to make the channels auto-reset?

yes can be done. please do dm to moderator

Yes, I have already spoken to you privately, please let me know if you respond.

Hello, does anyone know how to turn this option off? Use manifest URL params for segments, this comes in automatically and the streams are restarted every 4 minutes

admin your config is shit

if you dont know how to use config is shit ??