Medusa installed but wont run Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
mrgreaper
Posts: 12
Joined: Sat Jan 04, 2020 10:27 pm

Re: Medusa installed but wont run

Post by mrgreaper »

Joulinar wrote: Tue Oct 20, 2020 12:18 am ok I missed sudo as I'm doing all this as user root ;)

pls can you post following

Code: Select all

systemctl cat medusa.service
groups medusa
the first command seems to do the same as loading it into nano:

Code: Select all

dietpi@DietPi:/etc/systemd/system$ sudo systemctl cat medusa.service
# /etc/systemd/system/medusa.service
# Medusa systemd service unit file
#
# Configuration Notes
#
#    - Option names (e.g. ExecStart=, Type=) are case-sensitive)
#
#    - Adjust User= and Group= to the user/group you want Medusa to run as.
#
#    - Optional adjust EnvironmentFile= path to configuration file
#        Can ONLY be used for configuring extra options used in ExecStart.
#        Putting a minus (-) in front of file means no error warning if the file doesn't exist
#
#    - Adjust ExecStart= to point to your python and Medusa executables.
#       The FIRST token of the command line must be an ABSOLUTE FILE NAME,
#       then followed by arguments for the process.
#       If no --datadir is given, data is stored in same dir as start.py
#       Arguments can also be set in EnvironmentFile (except python)
#
#    - WantedBy= specifies which target (i.e. runlevel) to start Medusa for.
#        multi-user.target equates to runlevel 3 (multi-user text mode)
#        graphical.target  equates to runlevel 5 (multi-user X11 graphical mode)
#

### Example Using Medusa as daemon with pid file
# Type=forking
# PIDFile=/var/run/PyMedusa/Medusa.pid
# ExecStart=/usr/bin/python3 /opt/medusa/start.py -q --daemon --nolaunch --pidfile=/var/run/PyMedusa/Medusa.pid --datadir=/opt/medusa

## Example Using Medusa as daemon without pid file
# Type=forking
# GuessMainPID=no
# ExecStart=/usr/bin/python3 /opt/medusa/start.py -q --daemon --nolaunch --datadir=/opt/medusa

### Example Using simple
# Type=simple
# ExecStart=/usr/bin/python3 /opt/medusa/start.py -q --nolaunch

### Example Using simple with EnvironmentFile where APP_DATA=/home/medusa/.medusa in /etc/medusa.conf
# Type=simple
# EnvironmentFile=/etc/medusa.conf
# ExecStart=/usr/bin/python3 /opt/medusa/start.py -q --nolaunch --datadir=${APP_DATA}

### Configuration

[Unit]
Description=Medusa Daemon
After=network.target

[Service]
User=medusa
Group=medusa

Type=simple
ExecStart=/usr/bin/python3 /mnt/dietpi_userdata/medusa/start.py -q --nolaunch --datadir=/mnt/dietpi_userdata/medusa
TimeoutStopSec=25
KillMode=process
Restart=on-failure

[Install]
WantedBy=multi-user.target
dietpi@DietPi:/etc/systemd/system$
second command:

Code: Select all

dietpi@DietPi:/etc/systemd/system$ sudo groups medusa
medusa : dietpi

Side note: The help getting this sorted is appreciated
User avatar
Joulinar
Posts: 2597
Joined: Sat Nov 16, 2019 12:49 am

Re: Medusa installed but wont run

Post by Joulinar »

ok somehow the user group did not changed

Code: Select all

[Service]
User=medusa
Group=medusa
it should be

Code: Select all

[Service]
User=medusa
Group=dietpi
pls try again to do this as user root

Code: Select all

G_CONFIG_INJECT 'Group=' 'Group=dietpi' /etc/systemd/system/medusa.service
output should looks like this

Code: Select all

root@DietPi3:~# G_CONFIG_INJECT 'Group=' 'Group=dietpi' /etc/systemd/system/medusa.service
[  OK  ] G_CONFIG_INJECT | Setting in /etc/systemd/system/medusa.service adjusted: Group=dietpi
root@DietPi3:~#
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
mrgreaper
Posts: 12
Joined: Sat Jan 04, 2020 10:27 pm

Re: Medusa installed but wont run

Post by mrgreaper »

Joulinar wrote: Tue Oct 20, 2020 12:29 am ok somehow the user group did not changed

Code: Select all

[Service]
User=medusa
Group=medusa
it should be

Code: Select all

[Service]
User=medusa
Group=dietpi
pls try again to do this as user root

Code: Select all

G_CONFIG_INJECT 'Group=' 'Group=dietpi' /etc/systemd/system/medusa.service
output should looks like this

Code: Select all

root@DietPi3:~# G_CONFIG_INJECT 'Group=' 'Group=dietpi' /etc/systemd/system/medusa.service
[  OK  ] G_CONFIG_INJECT | Setting in /etc/systemd/system/medusa.service adjusted: Group=dietpi
root@DietPi3:~#
I always thought sudo was to do a command as the root user, after reading your reply I found out thats not really the case....
A quick bit of googling and i learnt how to log in as root user.

now the config_inject thing worked and i can load medusa! yay...thank you!

Code: Select all

root@DietPi:/etc/systemd/system# G_CONFIG_INJECT 'Group=' 'Group=dietpi' /etc/systemd/system/medusa.service
[  OK  ] G_CONFIG_INJECT | Setting in /etc/systemd/system/medusa.service adjusted: Group=dietpi
root@DietPi:/etc/systemd/system# systemctl daemon-reload
root@DietPi:/etc/systemd/system# systemctl restart medusa.service
root@DietPi:/etc/systemd/system# systemctl status medusa.service
● medusa.service - Medusa Daemon
   Loaded: loaded (/etc/systemd/system/medusa.service; disabled; vendor preset: enabled)
   Active: active (running) since Mon 2020-10-19 23:40:17 BST; 15s ago
 Main PID: 4167 (python3)
    Tasks: 2 (limit: 4915)
   Memory: 103.0M
      CPU: 11.537s
   CGroup: /system.slice/medusa.service
           ├─4167 /usr/bin/python3 /mnt/dietpi_userdata/medusa/start.py -q --nolaunch --datadir=/mnt/dietpi_userdata/medusa
           └─4176 ffprobe -version

Oct 19 23:40:17 DietPi systemd[1]: Started Medusa Daemon.
User avatar
Joulinar
Posts: 2597
Joined: Sat Nov 16, 2019 12:49 am

Re: Medusa installed but wont run

Post by Joulinar »

on DietPi, login as user root is quite simple as it is not locked and usually it's using same password a user dietpi (if not changed) ;)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
mrgreaper
Posts: 12
Joined: Sat Jan 04, 2020 10:27 pm

Re: Medusa installed but wont run

Post by mrgreaper »

Joulinar wrote: Tue Oct 20, 2020 12:45 am on DietPi, login as user root is quite simple as it is not locked and usually it's using same password a user dietpi (if not changed) ;)
typed su and it asked for my password and all things worked lol Not exactly linux adapt (comfortable enough to know nano but thats about as far as i get, will use su from now on)
User avatar
Joulinar
Posts: 2597
Joined: Sat Nov 16, 2019 12:49 am

Re: Medusa installed but wont run

Post by Joulinar »

you could simply login as user root via SSH directly.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply