Menu

INSTALL for systemd

Anonymous
2017-10-10
2017-10-10
  • Anonymous

    Anonymous - 2017-10-10

    Edited by author [me] 2017 11 03

    The included 10-kuhler.rules udev rule to run on BOOTUP does not work with systemd setups and requires syntactical and control flow changes. Specifically, RUN+=/var/local/kuhlerd looks like an older syntax so cannot be parsed well. RUN{program}=/var/local/kuhlerd is the correct syntax as of late but it will not execute as expected. My workaround, which I share to enlighten other fans:

    /etc/udev/rules.d/10-kuhler.rules

    SUBSYSTEM=="usb", ATTR{idVendor}=="2433", ATTR{idProduct}=="b111", SYMLINK="kuhler", TAG+="systemd"
    

    This will create a device file on boot /dev/kuhler

    adduser -M kuhler -g kuhler

    chown kuhler /var/local/kuhlerd

    chown kuhler /var/local/kuhler_ctl

    Changing ownership may not be required since these executable belong to group kuhler per standard install. Included because this is my stable setup.

    /etc/systemd/system/dev-kuhler.device

    # Once /dev/kuhler symlink is added to /dev, systemd will load this and pass control unto kuhlerd.service
    [Unit]
    Description=Kuhler Device Unit
    Requires=kuhlerd.service
    

    /etc/systemd/system/kuhlerd.service

    # This will start the daemon and guard against kuhler_ctl.service starting first
    [Unit]
    Descripton=Kuhler Daemon
    After=kuhler.device
    Before=kuhler_ctl.service
    [Service]
    User=kuhler
    Group=kuhler
    Type=forking
    ExecStart=/var/local/kuhlerd
    RemainAfterExit=yes
    

    /etc/systemd/system/kuhler_ctl.service

    # This will set up fan parameters.
    [Unit]
    Description=Kuhler Fan Control
    After=kuhlerd.service
    [Service]
    User=kuhler
    Group=kuhler
    Type=simple
    ExecStart=/var/local/kuhler_ctl -m1 -s34 -f38
    [Install]
    WantedBy=kuhlerd.service
    

    systemctl enable kuhler_ctl

    This assumes you want systemd to set parameters every boot in addition to loading the daemon.

    Tested on LFS 8.1-systemd edition.

    Suggestions, feedback to improve function or elegance or to educate encouraged! I think there may be some extraneous scripting here.

    Disclaimer: I tinker with Linux in my spare time and by no means do I consider myself a pro. My qualifications: Brain. My inspiration: RTFM.

    Edits:
    Run as a user kuhler as the less directly run as root the inherently safer?
    Change type to simple (oneshot may fail).
    Explicity add Before=kuhler_ctl.service to kuhlerd.service to help ensure kuhler_ctl does not fail (without dependency).

    Forge ahead!

     

    Last edit: kaywan joseph mansubi 2017-11-03
  • Anonymous

    Anonymous - 2017-10-10

    deleted by author, original post updated

     

    Last edit: kaywan joseph mansubi 2017-11-03

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.