Can only start codesyscontrol manually

DavidBo
2019-12-19
2019-12-19
  • DavidBo

    DavidBo - 2019-12-19

    I am using CODESYS Control for Raspberry Pi SL 3.5.15.20
    During boot codesyscontrol is executed but later it stops unexpectedly, and my codesys application will not boot.
    However, I can start my application later with /etc/init.d/codesyscontrol start
    I think the problem is caused by rc.local so here is the status.
    What is the problem?

    systemctl status rc-local.service
    Warning: The unit file, source configuration file or drop-ins of rc-local.service changed on disk. Run 'systemctl daemon-reload' to reload units.
    ● rc-local.service - /etc/rc.local Compatibility
       Loaded: loaded (/lib/systemd/system/rc-local.service; enabled-runtime; vendor preset: enabled)
      Drop-In: /lib/systemd/system/rc-local.service.d
               └─debian.conf
               /etc/systemd/system/rc-local.service.d
               └─ttyoutput.conf
       Active: failed (Result: exit-code) since Thu 2019-02-14 11:12:16 CET; 10 months 3 days ago
         Docs: man:systemd-rc-local-generator(8)
      Process: 396 ExecStart=/etc/rc.local start (code=exited, status=2)
    Feb 14 11:12:15 raspberrypi sudo[740]:     root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/home/pi/activateCAN.sh
    Feb 14 11:12:15 raspberrypi sudo[740]: pam_unix(sudo:session): session opened for user root by (uid=0)
    Feb 14 11:12:15 raspberrypi sudo[740]: pam_unix(sudo:session): session closed for user root
    Feb 14 11:12:15 raspberrypi sudo[750]:     root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/etc/init.d/codesyscontrol
    Feb 14 11:12:15 raspberrypi sudo[750]: pam_unix(sudo:session): session opened for user root by (uid=0)
    Feb 14 11:12:16 raspberrypi sudo[750]: pam_unix(sudo:session): session closed for user root
    Feb 14 11:12:16 raspberrypi sudo[410]: pam_unix(sudo:session): session closed for user root
    Feb 14 11:12:16 raspberrypi systemd[1]: rc-local.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
    Feb 14 11:12:16 raspberrypi systemd[1]: rc-local.service: Failed with result 'exit-code'.
    Feb 14 11:12:16 raspberrypi systemd[1]: Failed to start /etc/rc.local Compatibility.
    
     

    Related

    Talk.ru: 1

  • DavidBo

    DavidBo - 2019-12-19

    Problem solved.
    rc.local starts a script startPLCCAN.sh
    For some reason in this script 'start' was missing for codesyscontrol. Here is the right content:

    \#!/bin/sh
    sudo /etc/init.d/codesyscontrol stop
    sudo /home/pi/activateCAN.sh
    sudo /etc/init.d/codesyscontrol start
    
     

Log in to post a comment.