Try su - -c 'command' Normal su (and kdesu I think) inherit the current user environment, the dash tells it to spawn a new one based on root. There are differences in the default path etc when running programs in this way which can cause obscure failures.
BillK On Thu, 2001-11-15 at 07:27, bascule wrote: > further to this i have discovered the following: > the following script will work when run from a console su'ed to root: > #!/bin/sh > echo DEFANGED.0 > exit > #!/bin/bash > urpmi.update localcooker > > so will the following: > #!/bin/bash > urpmi.update localcooker > /dev/null 2> /dev/null > > neither, when invoked ising alt-f2 and kdesu, will run, > i think this is related to why i cannot get the script mentioned below to > work from a root cronjob > > if someone could help me out here i would be very grateful, i cannot work out > the difference between 'kdesu /path/to/somescript' and su'ing to root in a > console and running '/path/to/somescript' clearly there is but it defeats me > > bascule > > On Monday 12 Nov 2001 8:59 pm, you wrote: > > i have a little script that i run every now and then as follows: > > > > #!/bin/bash > > #this runs rsync to update the local copy of cooker > > rsync -avL --delete --delete-after > > fr2.rpmfind.net::linux/Mandrake-devel/cooker/i586/ /mandrake/cooker/ > > > /dev/null 2> /dev/null > > #this updates urpmi database > > urpmi.update "localcooker" > /dev/null 2> /dev/null > > > > the problem is that the last line works fine if pasted into a console, and > > the first line clearly works since i can see both the name of the script > > and rsync listed in ksysguard, however, urpmi never runs when running the > > script, i'm probably going to kick myself when i find out what i'm missing > > but i just can't work out what's wrong since the same urpmi line does work > > when run manually > > > > help gratefully received :-) > > > > bascule > > > > p.s. anyone wishing to confirm whether i need both --delete options to only > > delete old files 'after' syncing them-please feel free, the man pages for > > rsync weren't clear on this point > > ---- > > This message has been 'sanitized'. This means that potentially > dangerous content has been rewritten or removed. The following > log describes which actions were taken. > > Sanitizer (start="1005781766"): > Part (pos="2507"): > SanitizeFile (filename="unnamed.txt", mimetype="text/plain"): > Match (rule="2"): > Enforced policy: accept > > Defanged UNIX shell script(s). > > Part (pos="4308"): > SanitizeFile (filename="message.footer", mimetype="text/plain"): > Match (rule="default"): > Enforced policy: defang > > Replaced mime type with: application/DEFANGED-1 > Replaced file name with: message_footer.DEFANGED-1 > > Total modifications so far: 2 > > > Anomy 0.0.0 : Sanitizer.pm > $Id: Sanitizer.pm,v 1.32 2001/10/11 19:27:15 bre Exp $
Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
