Issue
[Unit]
Description=Toasty
After=multi-user.target
[Service]
WorkingDirectory=/mnt/data/Toasty
User=root
Group=root
ExecStart=/usr/local/bin/python3.5 /mnt/data/Toasty/run.py
Type=idle
Restart=always
RestartSec=2
[Install]
WantedBy=multi-user.target
What i want is the ability to specify a core for my python code to run on.
Solution
Try adding ExecStartPost=/path/to/taskset -cp 1 $MAINPID
to your Install
section.
[Unit]
Description=Toasty
After=multi-user.target
[Service]
WorkingDirectory=/mnt/data/Toasty
User=root
Group=root
ExecStart=/usr/local/bin/python3.5 /mnt/data/Toasty/run.py
ExecStartPost=/path/to/taskset -cp 1 $MAINPID
Type=idle
Restart=always
RestartSec=2
[Install]
WantedBy=multi-user.target
Answered By - Daniel Answer Checked By - Willingham (WPSolving Volunteer)