LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 08-30-2021, 03:13 PM   #1
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 10 (Buster)
Posts: 3,382

Rep: Reputation: 141Reputation: 141
lircd and systemctl on Debian Buster


I took a 4 year sabbatical on a sailboat. I'm back and I've upgraded to Debian Buster and am trying to get mythtv running again. I have everything working properly except for lirc. I can get it to work if I do the following steps manually after a reboot. (By "get it to work" I mean that /usr/bin/irsend is actually sending the command data instead of waiting for the two services to be in an operational state.)

Code:
/usr/bin/systemctl stop lircd.socket lircd.service
/usr/bin/systemctl start lircd.socket lircd.service
I have a "modinit" section in /etc/lirc/lirc_options.conf as follows to do a fixup on /dev/ttyS0 and create /dev/lirc0:
Code:
[modinit]
code = /usr/bin/setserial /dev/ttyS0 uart none
code1 = /usr/sbin/modprobe lirc_dev
code2 = /usr/sbin/modprobe serial_ir
I've tried putting the two systemctl commands in /etc/lirc/lirc_options.conf as follows:

Code:
[modinit]
code = /usr/bin/setserial /dev/ttyS0 uart none
code1 = /usr/sbin/modprobe lirc_dev
code2 = /usr/sbin/modprobe serial_ir
code3 = /usr/bin/systemctl stop lircd.socket lircd.service
code4 = /usr/bin/systemctl start lircd.socket lircd.service
That doesn't work and I have to remove "code3" and "code4" in order to easily stop and start the lircd stuff. So it appears that I am trying to do this in the wrong place during startup. I can't find anything in the documentation that gives me any help. In fact, it took me several days to even determine that stopping and starting the lircd.socket and lircd.service would get lirc working. It's possible that I've got something else wrong and this is just a symptom, but I can't figure out where to go from here. Anyone have any suggestions?

Bob
 
Old 08-31-2021, 12:26 PM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 17,957
Blog Entries: 12

Rep: Reputation: 5433Reputation: 5433Reputation: 5433Reputation: 5433Reputation: 5433Reputation: 5433Reputation: 5433Reputation: 5433Reputation: 5433Reputation: 5433Reputation: 5433
Is the service enabled?
How is it being started?
Anything in the logs?

To answer these questions please post the following output:
Code:
systemctl is-enabled lircd.socket lircd.service
systemctl cat lircd.socket lircd.service
systemctl status -n99 lircd.socket lircd.service
 
Old 08-31-2021, 09:27 PM   #3
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 10 (Buster)
Posts: 3,382

Original Poster
Rep: Reputation: 141Reputation: 141
Please See next post.

(mass deletion)

Last edited by Quakeboy02; 08-31-2021 at 09:47 PM.
 
Old 08-31-2021, 09:43 PM   #4
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 10 (Buster)
Posts: 3,382

Original Poster
Rep: Reputation: 141Reputation: 141
As a result of seeing that lircd.socket wasn't enabled (probably a side effect of something I tried today) I enabled it, rebooted, and ran the commands again. It didn't fix the problem.

Code:
bob@musem:~$ systemctl is-enabled lircd.socket lircd.service
enabled
enabled
Code:
bob@musem:~$ systemctl cat lircd.socket lircd.service
# /lib/systemd/system/lircd.socket
[Socket]
ListenStream=/run/lirc/lircd

[Install]
WantedBy=sockets.target
Also=lircd.service


# /lib/systemd/system/lircd.service
[Unit]
Documentation=man:lircd(8)
Documentation=http://lirc.org/html/configure.html
Description=Flexible IR remote input/output application support
Wants=lircd-setup.service
After=network.target lircd-setup.service

[Service]
Type=notify
;ExecStartPre=/usr/bin/setserial /dev/ttyS0 uart none
;ExecStartPre=/usr/sbin/modprobe serial_ir
;ExecStartPre=/usr/sbin/modprobe lirc_dev
ExecStart=/usr/sbin/lircd --nodaemon
Code:
bob@musem:~$ systemctl status -n99 lircd.socket lircd.service
● lircd.socket
   Loaded: loaded (/lib/systemd/system/lircd.socket; enabled; vendor preset: ena
   Active: active (running) since Tue 2021-08-31 21:37:14 CDT; 1min 23s ago
   Listen: /run/lirc/lircd (Stream)
   CGroup: /system.slice/lircd.socket

● lircd.service - Flexible IR remote input/output application support
   Loaded: loaded (/lib/systemd/system/lircd.service; enabled; vendor preset: en
   Active: active (running) since Tue 2021-08-31 21:37:15 CDT; 1min 21s ago
     Docs: man:lircd(8)
           http://lirc.org/html/configure.html
 Main PID: 1564 (lircd)
    Tasks: 2 (limit: 4915)
   Memory: 1.1M
   CGroup: /system.slice/lircd.service
           └─1564 /usr/sbin/lircd --nodaemon

Last edited by Quakeboy02; 08-31-2021 at 09:45 PM.
 
Old 09-02-2021, 10:49 AM   #5
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 10 (Buster)
Posts: 3,382

Original Poster
Rep: Reputation: 141Reputation: 141
I've fixed this with a hack, as I just didn't know what else to do. Here's the start section of /etc/init.d/mythv-backend. Note the two lines under "#BOB". I figured this was a good place to put it, since the remote control is needed by mythtv. I'm sure there's a better way, but I can't find it.

Code:
case "$1" in
  start)

#BOB
/usr/bin/systemctl stop lircd.socket lircd.service
/usr/bin/systemctl start lircd.socket lircd.service

        if test -e $RUNDIR/$NAME.pid ; then
                echo "mythbackend already running, use restart instead."
        else
                echo -n "Starting $DESC: $NAME "
                start-stop-daemon --start --pidfile $RUNDIR/$NAME.pid \
                        --chuid $USER --nicelevel $NICE --exec $DAEMON -- $ARGS
                echo "."
        fi
        ;;
 
Old 09-02-2021, 11:45 AM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 17,957
Blog Entries: 12

Rep: Reputation: 5433Reputation: 5433Reputation: 5433Reputation: 5433Reputation: 5433Reputation: 5433Reputation: 5433Reputation: 5433Reputation: 5433Reputation: 5433Reputation: 5433
It might help to start lircd.service delayed.
Also perform some troubleshooting on lircd-setup.service.
 
Old 09-02-2021, 12:35 PM   #7
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 10 (Buster)
Posts: 3,382

Original Poster
Rep: Reputation: 141Reputation: 141
Quote:
Originally Posted by ondoho View Post
It might help to start lircd.service delayed.
Also perform some troubleshooting on lircd-setup.service.
As I learned more about this over the past few days, I looked to see if systemctl started up mythtv-backend. No such luck, so I did it in the init file. But it's probably just a matter of time till mythtv-backend startup is moved to systemctl and it can be put there, or a "Wants" or something a bit more appropriate.

I did look into lircd-setup, but I couldn't find a way to accomplish what I needed. I'll review it in a few months to see if I can think of anything else.

Thanks for the help.

Bob
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] After having a successful installation of Debian Buster, Lenovo computer refuses to boot into Debian Buster 10.2 PicardDefendingData Debian 4 12-21-2019 07:51 PM
LXer: Debian 11 "Bullseye" and Debian 12 "Bookworm" Are Coming After Debian 10 "Buster" LXer Syndicated Linux News 0 04-18-2018 12:26 PM
Restart systemctl*daemon​ - systemctl command not found cjosephl Linux - Newbie 7 11-11-2017 04:53 PM
Mandrake 10.1, lircd, lircmd conn-fused Linux - Hardware 0 01-29-2005 06:12 PM
lirc lircd installation freevo mimsmall Fedora 1 05-11-2004 07:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration