SystemD service script

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

SystemD service script

Michelle Dupuis-2

Has anyone created a systemd service script for Misterhouse?


As well, can someone offer a link to a page showing MH startup options?  (I assume there are command line options)


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users

Rob
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SystemD service script

Rob
My house relies on EIB/KNX so I only start mh when eibd is active.

# mh - startscript for the Mister House daemon
description "start and stop misterhouse"

start on started eibd
stop on runlevel [!2345]

console log

setuid mh
setgid mh

exec /home/mh/start-mh


start-mh is a script that I use when I start mh interactively, so I use this instead of putting all commands in the init script


#!/bin/sh
export mh_parms=/home/mh/mh.private.ini
cd /home/mh
/opt/mh/bin/mh &
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: SystemD service script

Jim Duda
Administrator
In reply to this post by Michelle Dupuis-2


On 01/18/2017 09:04 PM, Michelle Dupuis wrote:
> Has anyone created a systemd service script for Misterhouse?
>
>
> As well, can someone offer a link to a page showing MH startup options?  (I assume there are command line options)
>
>

This is the one I created/use in my installation.

[Unit]
Description=Misterhouse Home Automation
Requires=festival.service owserver.service mariadb.service network.target
After=dbus.service festival.service owserver.service mariadb.service

[Service]
Type=simple
#User=misterhouse
#Group=users
Environment=HOME=/home/misterhouse
Environment=mh_parms=/home/misterhouse/mh.private.ini,/home/misterhouse/mh.local.private.ini
Environment=PATH=/usr/local/sbin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin
Environment=DISPLAY=:0
Environment=LANG=C
ExecStartPre=-/bin/mv /home/misterhouse/logs/misterhouse.log.3 /home/misterhouse/logs/misterhouse.log.4
ExecStartPre=-/bin/mv /home/misterhouse/logs/misterhouse.log.2 /home/misterhouse/logs/misterhouse.log.3
ExecStartPre=-/bin/mv /home/misterhouse/logs/misterhouse.log.1 /home/misterhouse/logs/misterhouse.log.2
ExecStartPre=-/bin/mv /home/misterhouse/logs/misterhouse.log.0 /home/misterhouse/logs/misterhouse.log.1
ExecStartPre=-/bin/mv /home/misterhouse/logs/misterhouse.log   /home/misterhouse/logs/misterhouse.log.0
ExecStart=/home/misterhouse/mh/bin/mh -log_file /home/misterhouse/logs/misterhouse.log
ExecStop=/bin/kill -s HUP $MAINPID

[Install]
WantedBy=multi-user.target


Regards,

Jim



------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users

Loading...