I guess my first question would be why the script below has anything to do with /opt. I don't see a change of directory to anything under that directory and I would assume this is running in some directory you own.
System directory permissions are sometimes changed during software updates; annoying, but true. I sometimes have to change permissions on /usr/local/src for that reason. I don't know about your system, but on most, chown can only be run by root. I don't see any bash specific syntax in your script, so you might try running it under a different Bourne compatible shell (perhaps ash, dash, or ksh) to see if it works there. This will hopefully rule out the possibility of a bash bug. John L. Ries Salford Systems Phone: (619)543-8880 x107 or (435)867-8885 ________________________________ From: Logan Erbst <lo...@iccamnetworking.us> Sent: Wednesday, May 18, 2016 5:34 PM To: debian-user@lists.debian.org Subject: Re: Got that network problem solved, now a new one This seems to me that it may be a bug in the version of bash that is running on the system, but I could be very wrong. On 5/18/2016 4:42 PM, Gene Heskett wrote: Greetings all; I am, because my web page serves as a backup site for the os and some tools for use with the now 30 year old trs-80 color computers, have a script IP can run that pulls fresh copies of the sources for this code using hg, then builds fresh copies and makes it all available on my web page. Unfortunately that script, running as me, suddenly has no write permissions to do what it does. This has been working for several years. This is the script: ============================ #!/bin/bash # since I'm always forgetting who I am if [ `whoami` != 'gene' ]; then echo echo "!!!!!!!!!!!!!!!!!! Warning !!!!!!!!!!!!!!!!!!!" echo "this script needs to be run by user gene" echo echo exit 1 fi mv lwtools lwtools-$(date +%Y-%m-%d-%H-%M) hg clone http://lwtools.projects.l-w.ca/hg/ lwtools cd lwtools make sudo make install cd .. echo echo echo "lwtools has been built, next is toolshed" echo echo chown -R gene:www-data lwtools # make visible to the web mv toolshed toolshed-$(date +%Y-%m-%d-%H-%M) hg clone http://hg.code.sf.net/p/toolshed/code toolshed cd toolshed make -C build/unix sudo make install cd hdbdos make cd ../.. chown -R gene:www-data toolshed echo echo echo "toolshed has been built and installed, next is nitros9" echo echo mv nitros9 nitros9-$(date +%Y-%m-%d-%H-%M) hg clone http://hg.code.sf.net/p/nitros9/code nitros9 cd nitros9 export NITROS9DIR=$PWD hgpull;hgupdate mkdir dsks # this step is temporarily needed make dsk make dskcopy cd .. chown -R gene:www-data nitros9 echo echo "nitros9 has been refreshed" echo "this completes the build of lwtools, toolshed, and nitros9" ================================== and its now being denied at the first mv operation. /opt of course is owned by root:root but that hasn't changed in 18 years of running linux. This script has been running flawlessly about once a month since July 2013 when I wrote it. So what was changed to prevent the common user from using /opt as himself? cd'd to /opt, I can't even "touch ajunkfile". Grrrrrr. Me, goes in search of my LART. Better yet, how can I fix it? /opt permissions are 40755, and I'm assuming a chmod 0777 as root would fix it temporarily, but thats one hell of a kludge. I'd much rather find where the rules to this game are and get them fixed. Thanks all. Cheers, Gene Heskett -- Logan Erbst Member Free Software Foundation