Menu

#16 no signal on serial port - rtprio in limits.conf not working

Version2
closed
nobody
srcpd (10)
5
2023-03-06
2011-11-13
No

System:
Fedora 16 - 32 bit
srcpd 2.1.1
User and Group:
srcpd with rtprio set to 99

Socket communication works as expected and the serial port is blocked when srcpd is started, but when I perform "SET 1 POWER ON" theres no output on the serial port. the log in /var/log/messages looks like this:

Nov 13 22:09:22 modellbahn-rechner srcpd[1688]: [bus 0] Reading configuration for bus 'server'
Nov 13 22:09:22 modellbahn-rechner srcpd[1688]: [bus 1] ** Filename='/dev/ttyS0'
Nov 13 22:09:22 modellbahn-rechner srcpd[1688]: [bus 1] init GL: 81
Nov 13 22:09:22 modellbahn-rechner srcpd[1688]: [bus 0] Done /etc/srcpd.conf; found 2 buses
Nov 13 22:09:22 modellbahn-rechner srcpd[1686]: srcpd starten: [ OK ]
Nov 13 22:09:22 modellbahn-rechner srcpd[1691]: srcpd V2.1.1; SRCP 0.8.4; SRCPOTHER 0.8.3
Nov 13 22:09:22 modellbahn-rechner srcpd[1691]: [bus 0] init_bus 0
Nov 13 22:09:22 modellbahn-rechner srcpd[1691]: [bus 1] DDL init with debug level 5
Nov 13 22:09:22 modellbahn-rechner srcpd[1691]: [bus 1] DDL init done
Nov 13 22:09:22 modellbahn-rechner srcpd[1691]: [bus 0] Time thread created.
Nov 13 22:09:22 modellbahn-rechner srcpd[1691]: [bus 0] Starting 1 bus interface threads.
Nov 13 22:09:22 modellbahn-rechner srcpd[1691]: [bus 0] Starting interface thread number 1 (type = 1).
Nov 13 22:09:22 modellbahn-rechner srcpd[1691]: [bus 0] Thread on bus 1 is woken up
Nov 13 22:09:22 modellbahn-rechner srcpd[1691]: [bus 0] Netservice thread for port 4303 created.
Nov 13 22:09:22 modellbahn-rechner srcpd[1691]: All threads started
Nov 13 22:09:22 modellbahn-rechner srcpd[1691]: [bus 1] DDL bus started (device = /dev/ttyS0).
Nov 13 22:09:22 modellbahn-rechner srcpd[1691]: [bus 0] usleep() failed: Interrupted system call (errno = 4)
Nov 13 22:09:22 modellbahn-rechner srcpd[1691]: [bus 0] Changed to group srcpd
Nov 13 22:09:22 modellbahn-rechner srcpd[1691]: [bus 0] usleep() failed: Interrupted system call (errno = 4)
Nov 13 22:09:22 modellbahn-rechner srcpd[1691]: [bus 0] Changed to user srcpd
Nov 13 22:09:22 modellbahn-rechner srcpd[1691]: [bus 1] pthread_setschedparam() failed: Operation not permitted (errno = 1).
Nov 13 22:09:40 modellbahn-rechner dbus-daemon[796]: ** Message: No devices in use, exit
Nov 13 22:10:37 modellbahn-rechner srcpd[1691]: [bus 0] New connection received.
Nov 13 22:10:37 modellbahn-rechner srcpd[1691]: [bus 0] Connection from an IPv4 client
Nov 13 22:10:37 modellbahn-rechner srcpd[1691]: [bus 0] Connection from ::ffff:127.0.0.1/32815
Nov 13 22:10:45 modellbahn-rechner srcpd[1691]: [session 1] Session started (mode = 1).
Nov 13 22:10:45 modellbahn-rechner srcpd[1691]: [session 1] Command mode starting.
Nov 13 22:10:58 modellbahn-rechner srcpd[1691]: [bus 0] Thread on bus 1 is woken up
Nov 13 22:11:22 modellbahn-rechner srcpd[1691]: [bus 0] Thread on bus 1 is woken up
Nov 13 22:11:34 modellbahn-rechner srcpd[1691]: [session 1] List too short: 1
Nov 13 22:11:46 modellbahn-rechner srcpd[1691]: [session 1] Session entered cancel state (mode = 0).
Nov 13 22:11:46 modellbahn-rechner srcpd[1691]: [session 1] Unlocking GAs by session-id
Nov 13 22:11:46 modellbahn-rechner srcpd[1691]: [session 1] Unlocking GLs by session-id
Nov 13 22:11:46 modellbahn-rechner srcpd[1691]: [session 1] Session sucessfully cancelled.
Nov 13 22:12:50 modellbahn-rechner srcpd[1691]: SIGTERM(15) received! Terminating ...
Nov 13 22:12:50 modellbahn-rechner srcpd[1691]: [bus 0] usleep() failed: Interrupted system call (errno = 4)
Nov 13 22:12:50 modellbahn-rechner srcpd[1691]: Terminating SRCP service...
Nov 13 22:12:52 modellbahn-rechner srcpd[1691]: [bus 0] Netservice thread terminated.
Nov 13 22:12:52 modellbahn-rechner srcpd[1691]: [bus 0] Time thread cancelled.
Nov 13 22:12:52 modellbahn-rechner srcpd[1691]: [bus 1] pthread_cancel() failed: No such process (errno = 3).
Nov 13 22:12:52 modellbahn-rechner srcpd[1691]: [bus 1] DDL bus terminated.
Nov 13 22:12:52 modellbahn-rechner srcpd[1691]: [bus 1] Bus successfully cancelled.
Nov 13 22:12:52 modellbahn-rechner srcpd[1691]: SRCP service terminated.
Nov 13 22:12:52 modellbahn-rechner srcpd[1725]: srcpd beenden: [ OK ]

It looks like there is a problem with pthreads.

Discussion

  • Moritz Renftle

    Moritz Renftle - 2011-11-18

    Hello again,

    I tested srcpd with ubuntu 11.10 yesterday and got exactly the same problem:
    srcpd is not able to give the thread on bus 1 realtime permissions.

    After three hours of research and trial I finally found the problem:
    In new Versions of Ubuntu and Fedora PAM doesn't load the pam_limits module for su, so that the entries in /etc/security/limits.conf have no effect.

    THE SOLUTION is to edit the file /etc/pam.d/su and uncomment the line
    # session required pam_limits.so
    so that it looks like this:
    session required pam_limits.so

    ==> Now srcpd has the rights to start the thread on bus 1 that is controlling ttyS0.

     
  • Moritz Renftle

    Moritz Renftle - 2011-11-18
    • summary: srcpd won't generate signal on serial port-pthread problem? --> no signal on serial port - rtprio in limits.conf not working
     
  • Guido Scholz

    Guido Scholz - 2023-03-06
    • status: open --> closed
     
  • Guido Scholz

    Guido Scholz - 2023-03-06

    Hint in srcpd.conf man page is added to point to this optional issue and solution.

     

Log in to post a comment.