add post-install script to launch piplotter as systemd service
This commit is contained in:
7
install_scripts/create_service.sh
Executable file
7
install_scripts/create_service.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
cp -a "install_scripts/piplotter.service" /etc/systemd/system
|
||||
chown root:root /etc/systemd/system/piplotter.service
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable piplotter.service
|
||||
12
install_scripts/piplotter.service
Normal file
12
install_scripts/piplotter.service
Normal file
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=piplot2D Display Menu and Control
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
Group=root
|
||||
ExecStart=/usr/local/bin/piplotter
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
14
setup.py
14
setup.py
@@ -1,4 +1,15 @@
|
||||
from setuptools import setup, find_packages
|
||||
from setuptools.command.install import install
|
||||
import subprocess
|
||||
import os
|
||||
|
||||
class CustomInstallCommand(install):
|
||||
def run(self):
|
||||
install.run(self)
|
||||
current_dir_path = os.path.dirname(os.path.realpath(__file__))
|
||||
create_service_script_path = os.path.join(current_dir_path, 'install_scripts', 'create_service.sh')
|
||||
subprocess.check_output([create_service_script_path])
|
||||
|
||||
|
||||
with open("README.md", "r") as fh:
|
||||
long_description = fh.read()
|
||||
@@ -28,5 +39,6 @@ setup(
|
||||
"https://github.com/sinseman44/PyCNC/archive/v2.0.0.zip#egg=pycnc-2.0.0",
|
||||
],
|
||||
python_requires='>=3.6',
|
||||
scripts=['piplotter']
|
||||
scripts=['piplotter'],
|
||||
cmdclass={'install': CustomInstallCommand}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user