Symlink in ZM_DIR_EVENTS disapear after some minutes

Support and queries relating to all previous versions of ZoneMinder
Locked
domonet
Posts: 4
Joined: Wed Oct 29, 2008 8:31 pm

Symlink in ZM_DIR_EVENTS disapear after some minutes

Post by domonet »

Hi guys:

I would like to have in the events dir, the monitor's ID (like it actually is) and a symlink to the id ($mid) directory with the monitors name ( $monitor['Name']).

For example:
if i have in events the directory '1', and the name for that monitor id is 'Dome1', I want a symlink named Dome1 to '1' event directory.

When I create a new monitor, the symlink exist because there are this 3 lines in the zm_actions.php file.:

[code]mkdir( ZM_DIR_EVENTS."/".$mid, 0755 );
chdir( ZM_DIR_EVENTS );
symlink( $mid, $new_monitor['Name'] ); [/code]

But after some minuts the symlink is deleted.
Why the symlink is unlinked and how can I keep that?

Thank you very much for your time.
throwgood
Posts: 18
Joined: Mon Oct 27, 2008 10:33 pm

Post by throwgood »

Domonet,

Not sure about the first question you have there. In my installation the Monitor name is linked to the monitor ID.

apache apache 10
apache apache 11
apache apache 12
apache apache 7
apache apache 8
apache apache 9
apache apache Conference_Room_01 -> 12
apache apache LOBBY_IR_01 -> 7
apache apache Off308_IR_01 -> 9
apache apache Off309_IR_01 -> 8
apache apache Off312_IR_01 -> 10
apache apache Server_Room_01 -> 11

I would check for two things. One that the directories are owned by apache or whomever you set your User / Group to in your httpd.conf. Two your log files to see if some sort of clean up is being performed at or around the same time you symlink disappears. Also could you provide a bit more information of your setup such as the OS, your directory layout, and who owns what. Its kinda hard to diagnose the problem if you don't know what your working with besides the zoneminder version. Thanks.
domonet
Posts: 4
Joined: Wed Oct 29, 2008 8:31 pm

Post by domonet »

Thank you very much for your replay...
I solved the problem modifing the user table and others things like use du -s instead of df, but I'll explain you the scenario anyway:

- I have a ZM system with several user. I want assign a disk quota to each user like 20 or 50G. I didn't tried if adding an apache user, I get the same custom funcionalities in options->users, that I have for zm user. I used everytime the zm user.

To solve this I do a query on the DB with the current_user, find the mid, du -s to the /var/www/zm/events/midpath and get back the return disk usage value to the user page (when the page do the refresh, the % usage is updated), like Storage: 49% of 20G. Of course, with directory/symlink in events, I can eliminate some code.

Another things that i'm doing, is the possibility to send email with events attached to each different user, now as i can understand, this is possible only with 1 email address. Of course I modified the option->user table, to fill this information when I add a new user (same to send sms to different phone number), and when i delete it.

My ZM version is 1.23.3-3 (compiled from source)
My OS is linux ubuntu 8.04 Server.

Sorry for the delay...

My english sucks... I know... ;-)

D
Locked