PSXC-IMDB FAQ: -------------- Note: It would be appreciated if questions were directed to the board (http://imdb.psxc.com) - Perhaps someone already asked what you're having trouble with. Q: Upgrade is a bore, especially all the config files. Any tip? --------------------------------------------------------------- A: 1. There are ways to ease upgrades. For instance, my scripts always assume you have glftpd in /glftpd, not /jail/glftpd or some such. Symlinks can be used in such cases, so you do not have to edit GLROOT in all the non-config files. 2. I know a lot like to put everything under /glftpd/bin, even config files. Don't. Putting config files under /glftpd/etc is recommended by most scripters, and it will ease your job with upgrading, and not only for this script. 3. Read UPGRADING and CHANGELOG. Sometimes, the changes done is to something you do not use anyway, or the addition of a feature you care little for. Why upgrade when what you have is already working fine, and you are happy? 4. Learn to patch. Patching is something that will ease the changes done in the config files. Making a backup of your config prior to the patching is also recommended. 5. The configs for the addons can be copied to your psxc-imdb.conf. The addons will load psxc-imdb.conf, and any variables found there will override the ones in the actual addon. Also see 1. Q: What's the big deal about using the nfo_script patch in zs-c? ---------------------------------------------------------------- A: The big deal, as you put it, is that only .nfo files will be checked by the script. If zs-c's accept_script is used, *every* file will be checked by the script. That means a huge amount of cpu-time, memory, and other resources will be used. Uploading files takes longer - having a fast zipscript no longer matters, because it still have to wait for the script to finish checking the file. Add all the time wasted on checking non-nfo files, and you end up with a huge number if you (continue to) use zs-c's accept_script to invoke the script. Plain and simple - your site will be faster if you use nfo_script. Q: What does RELAXEDURLS in psxc-imdb.conf do? ---------------------------------------------- A: Since there is no default way to write a .nfo, the script will have to rely on a sort of guessing-method to find the correct imdb url. The higher the number in this variable, the likelyhood of it finding an url increases, but so does the the likelyhood of it finding an URL where there really is none. Here is a rundown of the different levels, starting with the highest relaxation: Level 4: any 7 or 8-digits number will trigger the script at this level, though only the first found will be used. Example: 'MOVIE ID: 1234567' Level 3: the first 7 or 8-digits number on the same line as the word 'imdb' will be used. Example: 'IMDB ID: 1234567' Level 2: the first consecutive digits after the text 'imdb.' but in the same string/word will be used. Example: 'imdb.com/title/tt1234567' Level 1: the first consecutive digits after the text 'http://' followed by the string 'imdb.' will be used. Example: 'http://imdb.com/title/tt1234567' Level 0: the first consecutive digits after the text 'http://' followed by the string '.imdb.' will be used. Example: 'http://us.imdb.com/title/tt1234567' To improve probability of finding the correct URL, it will start at the lowest level and work its way up to the limit you choose. So if you have put RELAXEDURLS="2" in psxc-imdb.conf, it will first do a level 0 search, then a level 1 and finally a level 2 search. If anything is found on an early level (level 1 for example) it will skip the rest of the levels. Q: What are the files in the "/diff" catalogue? ----------------------------------------------- A: Those are files used to patch sources. I've included those as they will help people making custom changes to the script upgrade easily. They can be used by "normal" people as well - for instance with the .conf files. Upgrading can be a bitch, especially when there're changes in the config file(s). Patching might be your best venue here. Here's a quick example: #> cd /tmp #> tar xfz psxc-imdb_v2.0j.tgz #> cd /glftpd/etc #> patch -p1 .rej will be created (here psxc-imdb.conf.rej) and you will have to make the changes manually. Most times, though, it will Just Work. Q: What is the best way to debug? --------------------------------- A: Depends. I'll do some examples, and tell you how I debug in each case: a. When you upload a .nfo, there is no files created in the dir (.date, .imdb etc, depending on your setup). 1. make sure your client can see hidden files (.message, .imdb etc). 2. run psxc-imdb-sanity.sh. 3. Kill the bot/disable the crontab. Type the following in a console window, using root account: 4. #> chroot /glftpd /bin/bash # chroots to /glftpd 5. #> cd /site/SECTION/RELEASEDIR/ # cds to a releasedir 6. #> /bin/psxc-imdb.sh name-of.nfo # emulates what zs-c or post_check # does when a .nfo is uploaded. 7. #> ls # make sure the .imdb (and others) # file(s) are there. 8. #> cat /ftp-data/logs/psxc-imdb.log # This will now have the path to # the releasedir and the imdb url. If you did all the 8 steps without anything being wrong, I suspect there either is a problem with how the script is called (zs-c, post_check), or a permission problem. If psxc-imdb-rescan.sh works, there is a problem with how the script is called. If not, there should be some output in your ftp client, and the problem is most likely permission based. If step 8 show fails, the script could either not find a valid url, or you did not kill your bot/disable the crontab entry. If step 7 fails, and step 6 does not report a problem, and the url in the .nfo is indeed valid, then you have a problem. Go through the config again, and if nothing surfaces, do step 1 to 5, but change step 6 to this: 6. #> bash -x -v /bin/psxc-imdb.sh name-of.nfo >debug.log 2>&1 Send the debug.log my way by email. b. Files in the releasedir are created, but nothing else happens. 1. kill the bot/crontab entry. 2. run psxc-imdb-sanity.sh. 3. upload a .nfo Type the following in a console window, using root account: 4. #> su 5. $> cat /glftpd/ftp-data/logs/psxc-imdb.log 6. $> /glftpd/bin/psxc-imdb.sh 7. $> cat /glftpd/ftp-data/logs/psxc-imdb.log If step 5 fails (the logfile is empty), you either did not kill your bot/crontab entry, or you have a permission problem. See above to find out what. If step 6 fails, and the url and path listed under step 5 is indeed valid, no output is given, and the log in step 7 is empty, you have a problem. If, however, something is still inside the log in step 5, you have a permission problem, and there really should have been some output. To debug this, go through step 1-5, but change step 6 to this: 6. $> bash -x -v /glftpd/bin/psxc-imdb.sh >debug.log 2>&1 Send the debug.log my way by email. c. Everything works except the addons. 1. run the addon from shell, using a non-root account, preferably the bot-user. 2. kill the bot/crontab entry. 3. run psxc-imdb-sanity.sh. 4. upload a .nfo Type the following in a console window, using root account: 5. #> su 6. $> /glftpd/bin/psxc-imdb.sh If there is a permission problem, or a bug, output will show. If nothing shows, you need to change the first line in the addon from this: #!/bin/bash to this: #!/bin/bash -x -v Then go thru step 2-5, and change step 6 to this: 6. $> bash -x -v /glftpd/bin/psxc-imdb.sh >debug.log 2>&1 Send the debug.log my way by email. This should cover debugging in most cases. Bot problems are quite a different thing, but normally not that common. Contact me by mail/board/irc if you have difficulties, and have exhausted every other venue. (Reading all this, you probably have ;) Q: I get something like "/bin/bash: /root/.bashrc: Permission denied" when running. ----------------------------------------------------------------------------------- A: This is usually the case when you're using a bot to invoke the script, and you started the bot by su'ing to the botuser from the root account, like this: #> su botuser $> What you should have done was this: #> su - botuser $> The extra '-' tells the su command to discard the environmental variables the root user has, and load whatever variables is default for the botuser. Q: The bot won't output anything! --------------------------------- A1: Did you change the trigger? I told you *NOT* to change the trigger. A2: Do you use the "full"-feature? is GLLOG in psxc-imdb.conf and psxc(IMDBMOVIE) in psxc-imdb-bot.tcl pointed to the same file? do the file exists? No? Fix it! Q: I can't get any output! -------------------------- A: There can be several reasons for this. - The first thing to do is turn DEBUG on, any tcl or crontab'ed script off and run it manually. The script will output some variables - see if they change on the way down. - Run psxc-imdb-sanity.sh - It might find something you've overlooked. - Other things to check are if the imdb-url is already in the IMDBURLLOG file - this will prevent any output. - You can also tail -f IMDBLOG and check to see if something is written there while you upload a new .nfo, and specifically if the path given is a valid one for glftpd's chrooted env. - run the script from chroot - this may provide valuable information if no .imdb file is even created in the dir: chroot /glftpd /bin/bash # standard way on chrooting cd /site/movies/releasedir # change dir to a dir with a .nfo /bin/psxc-imdb.sh releasename.nfo # run the script with the name of # of the .nfo file as argument If you get errors about missing libraries, copy them into the chroot'ed environment (/glftpd/lib/) Q: I get this output when I do 'ps -ax': psxc-imdb.sh --------------------------------------------------------------- A: This is normal for versions including and after v1.32. At least, one of these is normal. If you get more than one, that stays there over an extended period (more than 15mins), you should contact me. The reason you get this is because of a safeguard I've put it. Normally, the bot calls up an external script, wait until it the external script is finished, then continue the rest of the assignments. This is a good way to do stuff, if the external scripts exit cleanly, and are fast. Looking up iMDB-info can take a long time (network stuff, lynx behaving badly etc.) so we need the bot to start the external script, and leave it be, trusting that the script will do all the right stuff. If the bot should wait for the script to finish, it might be it would time out from the irc-channel, and no other output would be announced while it waited. This is def. not what we want. The bit tells you, in this instance at least, that the bot have no control over psxc-imdb.sh, or at least what will be returned to the bot will be ignored, as the bot will not know how to handle any return feed from the script. That is okay - the script should not return anything to the bot in any case. Q: The addon named psxc-symlink-maker.sh doesn't work. What to do? ------------------------------------------------------------------ A: This can be several things. The first thing to do is to just run the script from shell (/glftpd/bin/psxc-symlink-maker.sh). It might give some info on what's wrong. The second thing to do is to kill the bot/crontab entry you use to run psxc-imdb.sh, then upload a .nfo and run psxc-imdb.sh from shell. This might give an indication. The most normal reasons are bad config or that the bot do not have access to the symlink dirs. Q: The addon named psxc-imdb-nuker.sh doesn't work. What to do? --------------------------------------------------------------- A: Read the previous question. The most common reason for this is that the nuker binary is not owned by root, or do not have the UID bit set (+s).