Forum archive 2000-2006

Donald Behan - Unable to append to prob.pg.bak

Donald Behan - Unable to append to prob.pg.bak

by Arnold Pizer -
Number of replies: 0
inactiveTopicUnable to append to prob.pg.bak topic started 8/17/2001; 8:06:35 PM
last post 8/21/2001; 12:09:29 PM
userDonald Behan - Unable to append to prob.pg.bak  blueArrow
8/17/2001; 8:06:35 PM (reads: 1213, responses: 5)
I get the error message "unable to open prob.pg.bak for append" (where prob is the name of the problem) when trying to edit a problem. The file in question doesn't exist yet, as this is my first edit of the problem. What did I do wrong in setting up this set?

<| Post or View Comments |>


userZbigniew Fiedorowicz - Re: Unable to append to prob.pg.bak  blueArrow
8/18/2001; 11:31:10 AM (reads: 1415, responses: 1)
This is likely due to the web server process not having permission to write files in the directory containing the original problem, prob.pg. The group owning that directory should contain the user id under which httpd runs, and the directory should be group writable.

Zig Fiedorowicz

<| Post or View Comments |>


userDonald Behan - Re: Unable to append to prob.pg.bak  blueArrow
8/19/2001; 12:24:43 PM (reads: 1686, responses: 0)
In the templates directory I tried "chmod 660 setX" where setX is the directory name, and now I seem to be locked out of the directory altogether. I also tried chmod -u+rw and chmod -g+rw, neither of which helped. In diagnosing the original problem, does it help to know that I was able to overwrite files in this directory using the "cp" command?

<| Post or View Comments |>


userZbigniew Fiedorowicz - Re: Unable to append to prob.pg.bak  blueArrow
8/20/2001; 8:00:41 AM (reads: 1447, responses: 0)
In order to be able to access files in a directory, you need to set the execute "x" bit on the directory. So the correct command you should have used is "chmod 770 setX", or symbolically "chmod u+rwx setX; chmod g+rwx setX". It's also a good idea to set the group sticky bit for the directory via "chmod g+s setX". This insures that the group ownership of any file you create or modify in the directory is the same as the group ownership of the directory.

You should also be sure that the group owning setX is a group which includes the user id of the web server process, as well as yourself. If not, you can change the group ownership of setX with the command "chgrp webwork setX", where WeBWorK should be replaced by whatever name your sysadmin has given to the aforementioned group.

Zig Fiedorowicz

<| Post or View Comments |>


userArnold K. Pizer - Re: Unable to append to prob.pg.bak  blueArrow
8/20/2001; 10:50:28 AM (reads: 1430, responses: 0)
Hi Don,

One problem was that the permission for the pg files were set to 750, i.e. the owner could read (4), write (2), and execute (1), users in the group (including the webserver) could read and execute (but not write), and general users had no access. Note that execute permission for a text file is meaningless. I changed the permissions to 660 so that now you can edit the files over the web.

As Zig says, your original problem was likely due to the webserver not having permission to write to the directory in question. You probably changed these permissions, so I do not know what they were originally.

In general, the templates directory and its subdirectories should have permissions 770 and files in the templates directory and its subdirectories should have permissions 660 (but 770 does no harm). If you want any user on the system to be able to copy your problems, use 775 and 664. If you want to disable the ability to edit files over the web (e.g. if you are linking many courses to a central library of problems), use 750 and 640 (or 755 and 644).

<| Post or View Comments |>


userDonald Behan - Re: Unable to append to prob.pg.bak  blueArrow
8/21/2001; 12:09:29 PM (reads: 1433, responses: 0)
Now the problems in the directories that I set up using mkdir are not accessible at all. There is a script error when you try to access these problems. Also, as a beginner to Linux, I don't know how to set the permissions for a directory, as compared to setting the permissions for files.

<| Post or View Comments |>