Skip to content
This repository was archived by the owner on Nov 20, 2019. It is now read-only.
This repository was archived by the owner on Nov 20, 2019. It is now read-only.

Keyboard/mouse when start from service #3

@alkabal

Description

@alkabal

Hi

I have issue when start config from systemd keyboard and mouse does not work and impossible to switch from tty.

If i start from command line over ssh or direct on screen keyboard and mouse work fine using /home/machinekit/cortini/./runXmotion.py

xmotion.service

[Unit]
Description=Cortini Xmotion service
After=getty@tty1
[Service]
Type=simple
ExecStart=/home/machinekit/cortini/./runXmotion.py
User=machinekit
[Install]
WantedBy=multi-user.target

runXmotion.py

#!/usr/bin/python

import sys
import os
import subprocess
import time
from machinekit import launcher
from machinekit import config

launcher.register_exit_handler()
#launcher.set_debug_level(5)
os.chdir(os.path.dirname(os.path.realpath(__file__)))

mkconfig = config.Config()
if 'MACHINEKIT_INI' not in os.environ:  # export for package installs
    os.environ['MACHINEKIT_INI'] = mkconfig.MACHINEKIT_INI
    
if 'HAL_RTMOD_DIR' not in os.environ:  # export for package installs
    os.environ['HAL_RTMOD_DIR'] = '/usr/lib/linuxcnc'
    
#if 'DISPLAY' not in os.environ:  # export for connecting to display
#    os.environ['DISPLAY'] = ':0.0'

try:
    launcher.check_installation()
    launcher.cleanup_session()
    launcher.load_bbio_file('furaday_stepgen.bbio')
    launcher.install_comp('fur.comp')
    launcher.install_comp('toolchanger.comp')
    launcher.start_process('machinekit mainXmotion.ini')
    launcher.register_exit_handler()  # enable on ctrl-C, needs to executed after HAL files
    while True:
        launcher.check_processes()
        time.sleep(1)
except subprocess.CalledProcessError:
    launcher.end_session()
    sys.exit(1)

sys.exit(0)

mainXmotion.ini

[DISPLAY]
 DISPLAY = /home/machinekit/cortini/Xmotion-sudo.sh

Xmotion-sudo.sh

#!/bin/bash
sudo /home/machinekit/Xmotion/bin/release/Xmotion

Br

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions