Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure.pl and sockets #4

Open
nylonoxygen77 opened this issue May 23, 2012 · 4 comments
Open

configure.pl and sockets #4

nylonoxygen77 opened this issue May 23, 2012 · 4 comments

Comments

@nylonoxygen77
Copy link

Because of the mods I made to the restore workflow, I needed to install Castor on the same machine as Worker Node, which is not the machine that's running PresStore. Because of this, I had to edit configure.pl so that the nsdchat command ran through the socket. Without doing that, it was trying to reference the archive plan number and index on localhost, instead of the PresStore server. Changing the nsdchat command was the only thing I could do to make it work. Not sure how to suggest changing configure.pl to do this... maybe have it ask the user for the PresStore server address with a default of [localhost]?

I have a few other suggestions for the configuration:

  1. Have configure.pl alert the user if their password contains a colon or @ symbol that these characters are off-limits. Even escaping them with backslashes or percent codes doesn't work.
  2. run the same regexps command on the password so that if it contains special shell characters, they are escaped. My root password has 5 special characters in it. I had to escape them with a double backslash each when entering the password in configure.pl because perl needs to escape the backslash that escapes the special shell characters... fun.
  3. aw-queue.conf can contain the root password, in my installation it does. If someone knows where it is or does some trolling, they could obtain root's password easily. I would suggest either encoding the password somehow, or simply change the read permission on the file so that only administrators can read the file.
  4. you are using a base filename to name the XML files. This could cause problems if the user is trying to archive a project that contains several files with the same name in different directories. I could see this being a problem if there are, for example, multiple versions of the same media file (say hi, medium, and low res) and the editor organized them into folders named "high," "medium," "low" but left the filenames the same. I am passing the CatDV Clip ID to a field in PresStore - in this case the clip ID would be wrong. One way to remedy this is to actually use the Clip ID or prepend it to the filename for the XML file. If we're prepending, in WN you'd change the $f.xml to ${CREF}_$f.xml. To tell catdv-xml.pl which file to use, you can use the catdv command line to query for the Clip ID using the media path:

Note: I've symlinked /Applications/CatDV Worker/catdv in /usr/local/bin/

get the clip ID from CatDV

$clipid = catdv -mediafile "$ARGV[0]" -print1 CREF;
$clipid =~ s/\n//;

get the base filename (similar to $f in CatDV)

$xmlbasename = basename($ARGV[0]);

$xmlfile = "$clipid_$xmlbasename";

This works when testing catdv-xml.pl on the command line, I will test it in production and let you know how it turns out.

@szumlins
Copy link
Owner

The configure script currently auto-greps the hostname by running the hostname command during its runtime, so if it is run on a system other than the PresSTORE server, it will improperly build the aw-queue.conf file.

It is also important to note that aw-queue.pl does validate the hostname of the PresSTORE server against what the hostname is at run time, so if you have bad DNS or a bad lookup, it will likely fail to run.

@szumlins
Copy link
Owner

I finally began working on this last evening. I'm hoping in the next two weeks or so to have some more advanced round tripping of information back into CatDV

@nylonoxygen77
Copy link
Author

Nice! I have actually written a bash script to do this. It's a little bit of a hack. But the way it works is that it updates an "Archive History" field that tracks archive/restore events. Every time a clip is archived or restored the field has a line added. The job number and tape barcode are pushed back into CatDV. The only problem is triggering this script. I have tried to get PresStore to run it as a post archive script but it hasn't worked. I think it's because it's located on another machine, the machine that's running Worker Node. Because I have one machine running WN and one running PresStore, Castor has to be split between the two machines. I've tried running the script several different ways and it hasnt' worked. The other problem is that I also want it to track restores. There is no built-in post-restore command in PresStore so I have my restore-queue.sh script actually monitor PresStore for restore jobs, and if it finds one, it waits until the status changes to something other than "running," then the info is added to CatDV. I'll probably end up doing the same thing for archive jobs.

@szumlins
Copy link
Owner

Hey, send me an email, I have a completely revamped version of Castor in pre-beta that I figured you'd like to give a try. Don't want to make it public yet, but would be happy to send it your way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants