Need help writing StartupItem(or launchd?) for dansguardian
Hey there,
i have successfully set up squid and dansguardian (what a pain that was, haha!!!!!) and got squid to launch as a daemon at startup. i am quite new to this stuff, but thinking positive! i manage squid and dansguardian through webmin. i can easily start dansguardian through webmin and i can also start it by doing.
sudo /usr/local/sbin/dansguardian
in terminal. it's a unix-executable
without sudo it says
Viersteins-Power-Mac-G5:~ vierstein$ /opt/local/sbin/dansguardian; exit
Unable to setgid()
logout
i did not figure out yet how the dansguardian webmin module starts/stops dansguardian and which files it uses to do that..
now to finish all this i need to write a startup script for dansguardian, because doing it manually is a bit laborious. i am a bit desperate here, have been trying so many things during the last two days and i'm really stuck. hopefully somebody here knows a way to do this.
the following code I put in a file called DansGuardian in /Library/StartupItems/Dansguardian - the file is a unix-executable
#! /bin/sh
# DansGuardian Filter
. /etc/rc.common
StartService ()
if [ "${DGSQUID:=-NO-}" = "-YES-" ]; then
CheckForNetwork
if [ "${NETWORKUP}" = "-NO-" ]; then exit; fi
ConsoleMessage "Starting DansGuardian Content Filter"
/usr/local/sbin/dansguardian -s
fi
StopService ()
/usr/local/sbin/dansguardian -q
RestartService ()
/usr/local/sbin/dansguardian -r
RunService "$1"
my StartupParameters.plist file in the same folder says
Description = "DansGuardian Content Filter";
Provides = ("Content Filter");
Requires = ("Web Proxy");
OrderPreference = "None";
after rebooting i get this in console
SystemStarter[55]: The following StartupItems were not attempted due to failure of a required service:
SystemStarter[55]: /Library/StartupItems/DansGuardian
it would be great if somebody here knew how to do this:)
(copy&paste from http://discussions.apple.com/thread.jspa?threadID=2094011&messageID=9887461#9887 461 )
in case somebody else is looking for an answer on this, here is the working launchd script. i did not write it myself though..
put the following code in
/Library/LaunchDaemons/org.dansguardian.dansguardian.plist
change the "Program" string to point to your binary, and the "WatchPaths" as well. The way this one works is that it waits until Squid is launched before it starts. That's what the WatchPath does - it looks for Squid's PID file to be created, and then launches DansGuardian.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.dansguardian.dansguardian</string>
<key>Disabled</key>
<false/>
<key>UserName</key>
<string>root</string>
<key>GroupName</key>
<string>nogroup</string>
<key>Program</key>
<string>/opt/dansguardian/sbin/dansguardian</string>
<key>ProgramArguments</key>
<array>
<string>dansguardian</string>
<string>-N</string>
</array>
<key>RunAtLoad</key>
<false/>
<key>OnDemand</key>
<false/>
<key>WatchPaths</key>
<array>
<string>/opt/squid/var/logs/squid.pid</string>
</array>
<key>Umask</key>
<integer>027</integer>
<key>ServiceDescription</key>
<string>The DansGuardian Content Filter Daemon</string>
</dict>
</plist>
Similar Messages
-
Need help writing startupItem/launchd for dansguardian
Hey there,
i want to write a startupitem for dansguardian (or should i use launchd?).
i am quite new to this stuff, but thinking positive! the problem is i don't really know which file exactly starts dansguardian. there is a unix-executable in usr/local/sbin/dansguardian which i can use to start dansguardian through
sudo /usr/local/sbin/dansguardian
in terminal. without sudo it won't work, i then get a message saying
vierstein$ /opt/local/sbin/dansguardian; exit
Unable to setgid()
logout
i can manage dansguardian through a webinterface called webmin and i can easily start and stop it there through a link.
i did not figure out yet how the dansguardian webmin module starts/stops it and which files/commands it uses to do that..
how can i write a startup script for dansguardian, because doing it manually is a bit laborious. i am a bit desperate here, have been trying so many things during the last two days and i'm really stuck. hopefully somebody here knows a way to do this.
the following code I put in a file called DansGuardian in /Library/StartupItems/Dansguardian - the file is a unix-executable
#! /bin/sh
# DansGuardian Filter
. /etc/rc.common
StartService ()
if [ "${DGSQUID:=-NO-}" = "-YES-" ]; then
CheckForNetwork
if [ "${NETWORKUP}" = "-NO-" ]; then exit; fi
ConsoleMessage "Starting DansGuardian Content Filter"
/usr/local/sbin/dansguardian -s
fi
StopService ()
/usr/local/sbin/dansguardian -q
RestartService ()
/usr/local/sbin/dansguardian -r
RunService "$1"
my StartupParameters.plist file in the same folder says
Description = "DansGuardian Content Filter";
Provides = ("Content Filter");
Requires = ("Web Proxy");
OrderPreference = "None";
after rebooting i get this in console
SystemStarter[55]: The following StartupItems were not attempted due to failure of a required service:
SystemStarter[55]: /Library/StartupItems/DansGuardian
it would be great if somebody here knew how to do this rightin case somebody else is looking for an answer on this, here is the working launchd script. i did not write it myself though..
put the following code in
/Library/LaunchDaemons/org.dansguardian.dansguardian.plist
change the "Program" string to point to your binary, and the "WatchPaths" as well. The way this one works is that it waits until Squid is launched before it starts. That's what the WatchPath does - it looks for Squid's PID file to be created, and then launches DansGuardian.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.dansguardian.dansguardian</string>
<key>Disabled</key>
<false/>
<key>UserName</key>
<string>root</string>
<key>GroupName</key>
<string>nogroup</string>
<key>Program</key>
<string>/opt/dansguardian/sbin/dansguardian</string>
<key>ProgramArguments</key>
<array>
<string>dansguardian</string>
<string>-N</string>
</array>
<key>RunAtLoad</key>
<false/>
<key>OnDemand</key>
<false/>
<key>WatchPaths</key>
<array>
<string>/opt/squid/var/logs/squid.pid</string>
</array>
<key>Umask</key>
<integer>027</integer>
<key>ServiceDescription</key>
<string>The DansGuardian Content Filter Daemon</string>
</dict>
</plist> -
Need help writing host program using LabView.
Need help writing host program using LabView.
Hello,
I'm designing a HID device, and I want to write a host program using National Instrument's LabView. NI doesn't have any software support for USB, so I'm trying to write a few C dll files and link them to Call Library Functions. NI has some documentation on how to do this, but it's not exactly easy reading.
I've written a few C console programs (running Win 2K) using the PC host software example for a HID device from John Hyde's book "USB by design", and they run ok. From Hyde's example program, I've written a few functions that use a few API functions each. This makes the main program more streamlined. The functions are; GetHIDPath, OpenHID, GetHIDInfo, Writ
eHID, ReadHIC, and CloseHID. As I mentioned, my main program runs well with these functions.
My strategy is to make dll files from these functions and load them into LabView Call Library Functions. However, I'm having a number of subtle problems in trying to do this. The big problem I'm having now are build errors when I try to build to a dll.
I'm writing this post for a few reasons. First, I'm wondering if there are any LabView programmers who have already written USB HID host programs, and if they could give me some advice. Or, I would be grateful if a LabView or Visual C programmer could help me work out the programming problems that I'm having with my current program. If I get this LabView program working I would be happy to share it. I'm also wondering if there might already be any USB IHD LabView that I could download.
Any help would be appreciated.
Regards, George
George Dorian
Sutter Instruments
51 Digital DR.
Novato, CA 94949
USA
[email protected]
m
(415) 883-0128
FAX (415) 883-0572George may not answer you. He hasn't been online here for almost eight years.
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice -
Need help writing small program!
Hi. I'm learning Java programming, and I need help writing a small program. Please someone help me.
Directions:
Create a program called CerealCompare using an if-then-else structure that obtains the price and number of ounces in a box for two boxes of cereal. The program should then output which box costs less per ounce.class CerealCompare {
public static void main(String[] args) {
// your code goes here
}Hope that helps.
P.S. Java does not have an if-then-else statement. -
Need Help Writing Server side to submit form via API
Hey
I need help writing a serverside application to submit
information via API to a separate server.
I have a client that uses constant contact for email
campaigns. We want to add to her website a form taht submits the
information needed to subscribe to her email list, to constant
contact via API.
FORM.asp :: (i got this one under control)
name
email
and submits to serverside.asp
SERVERSIDE.ASP
In serverside.asp i need to have
the API URL
(https://api.constantcontact.com/0.1/API_AddSiteVisitor.jsp)
username (of the constant contact account)
password (of the constant contact account)
name (submited from form.asp)
email (submitted from form.asp)
redirect URL (confirm.asp)
Can anyone help get me going in the right direction?
i have tried several things i found on the net and just cant
get anyone to work correctly.
One main issue i keep having is that if i get it to submit to
the API url correctly - i get a success code, it doesnt redirect to
the page i am trying to redirect to.
ASP or ASP.NET code would be find.
THANKS
sam> This does require server side programming.
> if you dont know what that is, then you dont know the
answer to my question. I
> know what i need to do - i just dont know HOW to do it.
If you are submitting a form to a script on a remote server,
and letting
that script load content to the browser, YOU have no control
over what it
loads UNLESS there is some command you can send it that it
will understand.
No amount of ASP on your server is going to change what the
remote script
does.
http://www.constantcontact.com/services/api/index.jsp
they only allow their customers to see the instructions for
the API so i
can't search to see IF there is a redirect you can send with
the form info.
But posts on their support board say that there is.
Alan
Adobe Community Expert, dreamweaver
http://www.adobe.com/communities/experts/ -
Need Help to create new screen for RF Sapconsole
Hi Guru's
I'm new on RF (but some years in ABAP) since last week.
I need help to create new screens for RF (SAPLLMOB).
Can someone explain me the procedure to create screen (with ABAP code after) or perhaps someone have an exemple (simple or not) ?
I have to develop 2 new screens with really few time.
And, another subsidiary question :
how SAP can transfert information between the flash gun and the screen i have developped.
Is there some code to add to enable this functionality or it is include in SAPLLMOB on standard fields ????
It's a new strange world for me today...
Many thanks to everyone who can explain me
Alainhi,
I am facing this problem as well. Is there any reference to create the new screen?
Hope someone can help! Thanks!
Regards,
Darren -
How do I reorder songs in a playlist in the new itunes??? I can no longer just click and drag. When I click, it doesn't move!!!! Need help ASAP- trying to prepare for an aerobics class and need songs in a specific order!
Vera,
Use View > View Options, and set 'Sort By" to "Manual Order."
Then you will be able to drag-n-drop songs up and down the list. -
Need help with a activation code for Adobe Acrobat X Standard for my PC, Don't have older Version of Adobe Acrobat 9, 8 or 7.
You don't need to install the older version, you only need the serial number from your original purchase. If you don't have them to hand, did you register? If so, they should be in your Adobe account. If not you really need to contact Adobe, though it isn't clear they will be able to do anything without some proof of purchase etc.
-
I need help getting new authorization codes for digital copies
I need help getting new authorization codes for digital copies of movies. Can someone help me out?
There's a lot of results in Google when you search for this but unfortunately refreshing the page doesn't seem to generate a different code anymore. Mine also says already redeemed
-
I need help in Downloading Adobe Elements for my Mac & Adobe Acrobat for my laptop...I have been battling for the last day.
~graffiti wrote:
PjonesCET wrote:
I know if you attempt to download and exe file to Mac from a Mac Partition you'll get something like. Cannot not understand file format octet-stream. This means it does not recognize MS execute files.
Not necesarily. I've done it a few times.
PjonesCET wrote:
I'm not sure you can download a PC copy of Acrobat 9 unless you operating from bootcamp or other such application and running the PC partition.
Yes. You can.
I've learned something. New. This must be recently changed. That last time I clicked on a Link I though was a dmg file and turned out it was and exe file my Macs wouldn't allow me to do so. But haven't tried recently everytime and exe file comes up I cancel. I gues I am used to the time everytime a Virus or some other nasty was downloaded it was packaged in and exe file and Macs owuldn't allow it. I suppose with the INtel guts now they can no longer refuse to download. -
Maestro need help also code is 75957252 for bios password reset
maestro need help also code is 75957252 for bios password reset
This question was solved.
View Solution.Check your other post. I replied there.
****Please click on Accept As Solution if a suggestion solves your problem. It helps others facing the same problem to find a solution easily****
2015 Microsoft MVP - Windows Experience Consumer -
I need help getting the license number for Adobe Photoshop Elements. However, It doesn't recognize me as an authorized user. Can someone help?@
I am having the same problem...did you ever fix it?
-
I think I need help with driver (software) settings for D110a
I think I need help with driver (software) settings for D110a all-in-one
Product: D110a all-in-one
OS: Windows XP Professional
Error messages: None
Changes before problem appeared: None--new installation
The quality of photo images (mostly JPG files) in printouts is awful even though the files display beautifully on the PC screen. I am using
IrfanView software for displaying/printing. As far as I can tell, IrfanView is not the problem.
When I print the same images on a Deskjet 5150 attached to a different PC also running XP Pro and IrfanView, the quality of the printouts is at
least acceptable, Some would probably say good or very good.
It's dificult to explain in words the problem with the printouts. A picture of really pretty vegetables (squashes, tomatoes, watermelon, etc) comes
out much too red. Moreover, the red, which appears shaded on the screen, seems to be all one shade in the D110a printouts.
Something similar happens to a view of a huge tree in full leaf. On screen, there are subtle variations in the "greenness" of the leaves. In the
printout, all green is the same shade. In the same printout, the trunk of the tree is all a single shade of grey. It isn;t even obvious that the
trunk is a round, solid object.
I liken the effect to audio that disappears entirely when you lower the volume and gets clipped into square waves in even moderately loud passages.
I don't know whether the D110a driver software permits adjusting the parameters that appear to be set incorrectly, and if adjustments are possible,
how I would identify which parameters to adjust, how I would access them, or how I would adjust them. I'm hoping that someone can help. Thanks.
I forgot to mention that I have used the diagnostic application and it tells me that there are no problems.
e-mail me at [email protected]brazzmonkey wrote:
Hi everyone,
I noticed the following message when network starts on my gateway
Warning: This functionality is deprecated.
Please refer to /etc/rc.conf on how to define a single wired
connection, or use a utility such as netcfg.
Then I realized the way network settings should be written in rc.conf has changed. But I can't figure out how this should be done.
Currently, my set up is the following (old way):
INTERFACES=(eth0 eth1)
eth0="dhcp"
eth1="eth1 192.168.0.10 netmask 255.255.255.0 broadcast 192.168.0.255"
ROUTES=(!gateway)
eth0 is on DHCP because the IP is dynamically assigned my ISP.
eth1 has a fix IP because it's on the LAN side.
No problem to use DHCP on eth0 with the new settings.
But for eth1, I don't know what I am supposed to write for gateway.
Wiki isn't clear on that one either, and it looks like many articles still refer to the old way.
Any guidance appreciated, thanks.
brazzmonkey,
you can't define 2 interfaces the old way (even though I saw some tricky workaround somewhere in the forums).
Use, f.e., netcfg:
Comment your old lines.
In /etc/rc.conf insert:
NETWORKS=(Eth0-dhcp Eth1-static)
DAEMONS=(..... !network @net-profiles ....)
In /etc/network.d create 2 files:
First one is named Eth0-dhcp.
Contents:
CONNECTION="ethernet"
DESCRIPTION="Whatever text"
INTERFACE=eth0
HOSTNAME="your hostname"
IP="dhcp"
DHCP_TIMEOUT=15
Second one is named Eth1-static.
Contents:
CONNECTION='ethernet'
DESCRIPTION='whatver'
INTERFACE='eth1'
HOSTNAME='hname'
IP='static'
ADDR='192.168.0.10'
GATEWAY='192.168.0.1' # your gateway IP
DNS=('192.168.0.1') # your DNS server
The names Eth0-dhcp and Eth1-static are not magic. They just must be the same in rc.conf and in /etc/network.d.
Hope it helps.
mektub
PS: netcfg must be installed.
Last edited by Mektub (2011-07-20 14:07:05) -
Need help reformatting my hard drive for mac only
Help please
Need help reformatting my hard drive for mac only with my toshishba hard driveWhat Mac is this please, with what version of OS X?
-
I need help writing a script that finds the first instance of a paragraph style and then changes it
I need help writing a script that finds the first instance of a paragraph style and then changes it to another paragraph style. I don't necessarily need someone to write the whole thing, by biggest problem is figuring how to find just the first instance of the paragraph style. Any help would be greatly appreciated, thanks!
Hi,
Do you mean first instance of the paragraph style
- in a chosen story;
- on some chosen page in every text frames, looking from its top to the bottom;
- in a entire document, looking from its beginning to the end, including hidden layers, master pages, footnotes etc...?
If story...
You could set app.findTextPreferences.appliedParagraphStyle to your "Style".
Story.findText() gives an array of matches. 1st array's element is a 1st occurence.
so:
Story.findText()[0].appliedParagraphStyle = Style_1;
//==> this will change a paraStyle of 1st occurence of story to "Style_1".
If other cases...
You would need to be more accurate.
rgds
Maybe you are looking for
-
Jabber / Presence status phones with no Jabber client
Hello, I was wondering if the Jabber client displays the presence status of other phones in the culster (linked to a user, but the user himself does not have a Jabber client)? If yes, can you provide me the steps required for this setup? We have a cu
-
Hello, my iPod touch is not working right. It says its connected but if I select App Store, safari and other apps that require wifi pops out a note saying either"error loading" or "cannot connect to iTunes Store" and would exit the app automatically.
-
Using an late 2007 MBP with mac osx 10.6.1 or xx.x.2 or w/e now with itunes 9 just yesterday i watched Total Recall in full screen via my dvi to hdmi connection with my 32inch toshiba. today i rented The Soloist and now i cant watch any of my movies
-
what do u mean by Hierarchial alv's and what is the exact purpose of them according to ooabap functionality and can anybody explain various issues regarding it,If possible with an example.
-
How can I decode the phone company closed on the At
How can I decode the phone company closed on the At