Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot run "sudo /etc/ss-bash/ssadmin.sh start" in /etc/rc.local #41

Open
williamyinssw opened this issue Jul 13, 2017 · 4 comments
Open

Comments

@williamyinssw
Copy link

I can run it in ssh, but when I put "sudo /etc/ss-bash/ssadmin.sh start" in /etc/rc.local, I always receive an error message saying "sscounter.sh启动失败"

The below is the error log, any idea?

rc-local.service - /etc/rc.local Compatibility
Loaded: loaded (/lib/systemd/system/rc-local.service; static; vendor preset: enabled)
Drop-In: /lib/systemd/system/rc-local.service.d
└─debian.conf
Active: failed (Result: exit-code) since Thu 2017-07-13 03:18:37 UTC; 11min ago
Process: 1150 ExecStart=/etc/rc.local start (code=exited, status=1/FAILURE)

Jul 13 03:18:33 ubuntu-16-04-LTS-SG systemd[1]: Starting /etc/rc.local Compatibility...
Jul 13 03:18:35 ubuntu-16-04-LTS-SG sudo[1152]: root : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/etc/ss-bash/ssadmin.sh start
Jul 13 03:18:35 ubuntu-16-04-LTS-SG sudo[1152]: pam_unix(sudo:session): session opened for user root by (uid=0)
Jul 13 03:18:37 ubuntu-16-04-LTS-SG rc.local[1150]: sscounter.sh启动中...
Jul 13 03:18:37 ubuntu-16-04-LTS-SG rc.local[1150]: sscounter.sh启动失败
Jul 13 03:18:37 ubuntu-16-04-LTS-SG systemd[1]: rc-local.service: Control process exited, code=exited status=1
Jul 13 03:18:37 ubuntu-16-04-LTS-SG systemd[1]: Failed to start /etc/rc.local Compatibility.
Jul 13 03:18:37 ubuntu-16-04-LTS-SG systemd[1]: rc-local.service: Unit entered failed state.
Jul 13 03:18:37 ubuntu-16-04-LTS-SG systemd[1]: rc-local.service: Failed with result 'exit-code'.

@Miigon
Copy link

Miigon commented Jul 29, 2017

Failed to run sscounter. Maybe failed to create interval timer.

@Miigon
Copy link

Miigon commented Jul 29, 2017

Because sscounter runs as a process,not a daemon, it may have some problem in such a special session (rc.local)

@geekbanana
Copy link

geekbanana commented Jul 17, 2019

Here is my /etc/rc.local

#!/bin/sh -e
/root/customer/ss-bash-master/ssadmin.sh start > /root/ssadmin_log.log
/appex/bin/lotServer.sh start -> /root/lotServer_log.log
exit 0

there are two auto start command, It can start lotServer.sh correctly, but cannot start ssadmin.sh
However, ssadmin_log.log shows ssadmin has been started

sscounter.sh启动中...
677 ? S 0:00 /bin/bash /root/customer/ss-bash-master/sscounter.sh
sscounter.sh已启动
ssserver启动中...
704 ? S 0:00 /usr/bin/python3 /usr/local/bin/ssserver -qq -c /root/customer/ss-bash-master/ssmlt.json
ssserver已启动

But when I run /root/customer/ss-bash-master/ssadmin.sh status show ssadmin.sh has NOT ben started.

~# /root/customer/ss-bash-master/ssadmin.sh status
ssserver未启动
sscounter.sh未启动

Why ?

@geekbanana
Copy link

I have fingure out the problem.
change #!/bin/sh -e to #!/bin/bash can solve the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants