I'm running a game server (unreal tournament 2004) on Centos 6 x86. I use a sh script to start it in a background process. This process (game server) creates different files (demos, logs) and they all come with 0600 permission by default. I have to process them with some applications so what I want is to change their default permission (to 0644 for example).
I'm root, I have umask 022 and files I create are 0644 by default. But it seems like this game server process don't inherit my umask. How can I change it? I'm pretty new to linux so a detailed answer would be appreciated.
Script used for running server:
#!/bin/sh # Set the following to your UT2004 directory. UT2004HOME=/home/ut2004 LOG=Server1.log if [ ! -d "$UT2004HOME/Logs" ]; then mkdir $UT2004HOME/Logs fi cd $UT2004HOME/System while true; do ./ucc-bin server DM-Rankin-FE?game=XGame.xDeathMatch?Mutator=UTzoneTAv1.MutUTzoneTA,utcompv17a.MutUTComp,XWeapons.MutNoSuperWeapon,XGame.MutNoAdrenaline?MaxPlayers=2?DoubleDamage=False?TimedOverTimeLength=0?GameStats=True?AntiTCCSettings=NoMidGameChecks ini=server1.ini -nohomedir -lanplay &> $UT2004HOME/Logs/$LOG DATE=20`date +%y%m%d`-`date +%H%M%S` mv $UT2004HOME/Logs/$LOG $UT2004HOME/Logs/crash-$DATE.log done;
I put it in an sh file and then start it in putty shell as root as a background process using & on the end of string.
ls -ld $UT2004HOME/Logs:
drwxr-xr-x 2 root root 4096 Sep 1 10:22 /home/ut2004/Logs
files in this directory are
The output for 2 other directories that contain files I need to be
rwxr-xr-x is the same:
drwxr-xr-x 2 root root 45056 Sep 26 14:16 /home/ut2004/Demos drwxr-xr-x 2 root root 28672 Sep 26 18:03 /home/ut2004/UserLogs
but files in them are
When I ran the command
file ./ucc-bin it was reported to be a binary file.