[Solved] Octoprint instances autorun problem

Hello

I want to solve the old problem.

I have a script that I run manually for additional three multiple instances and all work fine, but need to add it to autorun.
octoprint_startup.sh:

#!/bin/bash
~/oprint/bin/python ~/OctoPrint/run --daemon start --port 5001 --pid /tmp/octoprint1 --basedir ~/.octoprint1
~/oprint/bin/python ~/OctoPrint/run --daemon start --port 5002 --pid /tmp/octoprint2 --basedir ~/.octoprint2
~/oprint/bin/python ~/OctoPrint/run --daemon start --port 5003 --pid /tmp/octoprint3 --basedir ~/.octoprint3

Rights:

-rwxrwxrwx 1 pi pi 487 Jul 3 10:22 octoprint_startup.sh

/etc/rc.local

#!/bin/sh -e
/home/pi/octoprint_startup.sh
exit 0

I'm added >1.txt into octoprint_startup.sh for first instance and here output:

Daemon operation via "octoprint --daemon start|stop|restart" is deprecated, please use "octoprint daemon start|stop|restart" from now on
Starting daemon...
Starting daemon...
Starting daemon...

What should I do to start all instances automatically?

Linux octopi 4.1.19-v7+
OctoPrint Version 1.3.5 (master branch)

Thanks for help!

1 Like

I did the autostart according to this tutorial and simply added a second octoprint file in /etc/init.d and /etc/default with the name octoprint2. In your case you would also add a third one.
You have to change the following in /etc/init.d/octoprint2

DESC="OctoPrint2 Daemon"
NAME="OctoPrint2"
PKGNAME=octoprint2

In the /etc/default/octoprint2 file I changed the port to 5001.
I also added a copy of the octoprint home folder with the name octoprint2 ( in my case to /home/pi/.octoprint2 ).
You have to edit the folder and config also in the /etc/default/octoprint2 file.
Mine looks like this

# base directory to use
BASEDIR=/home/pi/.octoprint2

# configuration file to use
CONFIGFILE=/home/pi/.octoprint2/config.yaml

# On what port to run daemon, default is 5000
PORT=5001

Hope that helps :slight_smile:

Ok, thanks all!

I found solution by Chris Riley
Here link: https://www.youtube.com/watch?v=7Saa1HpLRoM

I do all commands step by step. All settings remained unharmed

2 Likes

@brotherchris to the rescue :sunglasses::+1:

3 Likes