[ gpsdrive ] [gpsdrive] update-mapnik-from-planet.sh

haylocki haylocki at yahoo.co.uk
Mon Oct 15 02:10:08 AKDT 2007



Joerg Ostertag (gpsdrive Munich/Germany) wrote:
> 
> 
> Well i added a little search line. Which should also find the tool in your 
> home directory or at ../../planet-mirror/planet-mirror.pl
> 
> 

Seems to work for me :-)

After about 12 hours yesterdays version of the script finished. It reported
that it had imported thousands of nodes, but running 
mapnik-osm-updater.sh --count_db reported thousands of nodes, but no roads
:-(

Anyway I decided to look into why I get the chmod errors when I run the
script. 

And ended up changing the create user section to look like this :

############################################
# Create a user on the system
############################################
if [ -n "$create_osm_user" ] ; then
    test -n "$verbose" && echo "----- Check if we already have an user
'$osm_username'"

    if ! id "$osm_username" >/dev/null; then
	echo "create '$osm_username' User"
	useradd "$osm_username"
    fi

    if [ ! -d "/home/$osm_username/osm/planet" ]; then
	echo "creating directories"
        sudo mkdir -p "/home/$osm_username/osm/planet"

        # The user itself should be allowed to read/write all his own files
        # in the ~/osm/ Directory
        sudo chown "$osm_username" "/home/$osm_username"
        sudo chown -R "$osm_username" "/home/$osm_username/osm"
        sudo chmod +rwX "/home/$osm_username"
        sudo chmod -R +rwX "/home/$osm_username/osm"

        # Everyone on the system is allowed to read the planet.osm Files
        sudo chmod -R a+rX "/home/$osm_username/osm"
    fi

fi


So now the directory is only created if it doesn't exist, and the
chown/chmod commands are only run if the directory has just been created.
Still needed the sudo's when not running the script as root.

Cheers, Ian

-- 
View this message in context: http://www.nabble.com/update-mapnik-from-planet.sh-tf4616879.html#a13209898
Sent from the GpsDrive mailing list archive at Nabble.com.



More information about the GPSdrive mailing list