|
|
#1 |
|
Prospect
Join Date: Jun 2012
Posts: 3
|
So, I have this deamon, it works great, catches SIGTERM etc
But sometimes it needs to be reset, and sometimes I'm gone when it needs to be sudo launchctl stoped-started and I cant do it. So I thought I would make a CGI perl script and chmod a+s it. But it dosent work. (I just realized that the fourm dosent save so I'll have to post again from my computer) |
|
|
|
|
|
#2 |
|
Site Admin
Join Date: Jan 2002
Location: Montreal
Posts: 31,940
|
You can't do it via a web server - or rather you don't want to do it that way since it would entail a huge security hole.
What people usually do is install the watchdog script that will restart the daemon if it detects trouble. Alternatively, just enable Remote Login and then ssh into the Mac from some remote machine and do what you need to do that way.
__________________
hayne.net/macosx.html |
|
|
|
|
|
#3 |
|
Prospect
Join Date: Jun 2012
Posts: 3
|
@hayne- Yes but if the Perl scripts are only running one command and you .Htaccess the files
then it would be pretty secure. i'm running a gaming server and it wouldn't be a HUGE problem either way i want to know what i'm doing wrong start.cgi: #!/usr/bin/perl stop.cgi: and the error log reads: [Sat Jun 09 16:41:22 2012] [error] [client 127.0.0.1] launch_msg(): Socket is not connected |
|
|
|
|
|
#4 |
|
League Commissioner
Join Date: Sep 2003
Location: Tokyo
Posts: 6,045
|
launchctl usually needs to be called as root, and your script doesn't do that. setuid has been disabled at the OS level for several versions now.
Your choices are: - set up a watchdog - learn how to use ssh - compile something and use that to talk to launchctl. Binary programs will still respond to setuid flags. (if you really don't care about security, it's possible to compile a one-liner that just calls a specific shell script.) |
|
|
|
|
|
#5 |
|
Prospect
Join Date: Jun 2012
Posts: 3
|
I guess i can just use SSH
Thanks Anyway!! |
|
|
|
![]() |
| Tags |
| apache cgi perl launchctl |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|