Bug with keeping logs?

Please, post here results:

Code:
/usr/local/directadmin/directadmin c | grep apache_public_html 
/usr/local/directadmin/directadmin c | grep secure_access_group

Check all files in /usr/local/directadmin/scripts/custom/, perhaps, some of them making wrong things.
 
I'm using mod_ruid so I think the first line won't work correct. This is the result:
apache_public_html=0
The second code gives:
secure_access_group=(null)

There are 2 scripts in /usr/local/directadmin/scripts/custom. The domain_create_post.sh is placed on the previous page here.
Then there is a user_create_post.sh with these contents:
#!/bin/sh
if [ "$spam" = "ON" ]; then
DIR=/home/$username/.spamassassin
mkdir $DIR
touch $DIR/user_prefs #or this is where you'd copy the default user_prefs you want them to have, instead of "touch".
chown ${username}:mail $DIR
chmod 771 $DIR
chown $username:$username $DIR/user_prefs
chmod 755 $DIR/user_prefs
touch $DIR/spam
chown mail:$username $DIR/spam
chmod 660 $DIR/spam
fi
exit 0;

Ah... I just discovered that the logs and the stats directory are now present. They are not made when the useraccount is created, but in some nightly event I guess. Because now there are there.
However in the wrong form, so DA creates them wrongly:
drwx------ 2 user user 4.0K Jan 23 00:10 logs
drwxr-xr-x 2 user user 4.0K Jan 23 00:10 stats

Strange that they are not touched when the user or domain is created but appear after a nightly event.
 
Indeed, so the solution you gave for putting the chmod in domain_create_post.sh won't work. Not that big an issue, I'm already grateful for your help.
Would it be a good idea to add a touch or mkdir command for both directory's in the domain_create_post.sh to fix the issue?

DA support said in this thread in reply #25, it would be better if logs where root:user 750

I could use the domain_create_post to change the attributes of the public_html directory.

I will put in a suggestion to indeed change logs to root:user 750 in the nightly tally.
 
I use the oneline solution to make it root:user which Zeiter gave in one of his posts of the previous page here, post #33.
 
Until now (I've been very busy) I do it on irregular basis, so manually like once a week. But I put in a suggestion in the suggestions section of the DA forum, to make this standard.
That way it will be done standardly.

The easy part would be to create the logs and stats directory with a custom domain_create_post.sh and chown and chmod them also in there.
That way it will be done automatically. I was going to do it that way to, but it was no major priority so I haven't done it yet.
Later this week I will tho.
 
ic, well ive created the domain_create and domain_change script for create the folder and give correct permission and ive also added a script once a day that correct those permission (i know is not useful at all but till is "built-in" i prefer be totally sure)

If you need it just tell me, no problem at all
 
Thanks for the offer but I already have the scripts for other reasons so I just have to add the few lines needed.
 
well, maybe someone else should need so, this is the content of those two files:

domain_create_post.sh
domain_change_post.sh

Code:
mkdir /home/$username/domains/$domain/logs
chown root:$username /home/$username/domains/$domain/logs
chmod 750 /home/$username/domains/$domain/logs
 
Back
Top