UNIX Users and Groups
Create local user accounts for the instructor and TAs for this course:
Create new groups for this course (the exact names are not specified):
addgroup <COURSE> addgroup <COURSE>_tas_www
If you are keeping old assignments around for comparison purposes, you may also want to add a group of just those that need access to the archives
Our policy is that all current / recent / future instructors for a course are in the archive group and permissions for all folders and files from old semesters are changed to allow read only access by the archive group. If a head TA will be running plagiarism detection or needs access to old files, the head TA will be added to the archive group for that semester, but by default head TAs are not added to the archive group.
Add the instructors into the course groups:
adduser instructor <COURSE> adduser instructor <COURSE>_tas_www adduser instructor <COURSE>_archive
Add the TAs into the course group:
adduser ta <COURSE>_tas_www
Add special users
adduser hwphp <COURSE>_tas_www adduser hwcron <COURSE>_tas_www adduser hwcgi <COURSE>_tas_www
Give permissions to create new users and update apache configurations
A. Add the instructor (and head TA) to the course_builders group:
adduser instructor course_builders
B. Give limited sudo to instructors and head TAs. Update the sudoers file using
visudoand add an entry at the end:
%course_builders ALL=(ALL:ALL) /var/local/submitty/bin/new.svnuser.pl,/var/local/submitty/bin/rcsonly.pl,/usr/sbin/apache2ctl,/var/local/submitty/bin/validate.svn.pl,/var/local/submitty/bin/validate.rcs.pl
(No longer needed at RPI)
OPTIONAL: It has been helpful to create a dummy student account for each instructor for testing purposes (e.g.
Prepare the course directory and course database
If the top level
submittydatabase does not exist, that must be created first. For more information: Database Overview
Run the create_course.sh script to create each new course. For example:
sudo /usr/local/submitty/bin/create_course.sh <SEMESTER> <COURSE> smithj <COURSE>_tas_www
This creates a course for the Fall 2016 semester, with course ID
<COURSE>, head instructor
smithjand TA group
Note: The TA group must contain the head instructor, any other instructors or head TAs who will help with configuration or builds of the homework, and the special users
hwcgi. Also the instructor must be part of the
Note: You will sometimes need to restart PHP-FPM after adding a course.
sudo service php7.0-fpm restart
You can confirm that a directory has been created and populated with initial files in the data directory. For this example (if you chose the default data directory location) the directory files will be here:
The create course script also creates and populates the course database. You can confirm that the database was created and populated by looking at the database
sudo su postgres psql \c submitty_<SEMESTER>_<COURSE> \dt \q
For more information: Database Overview
Add the instructor(s) to both the top level and course database:
sudo /usr/local/submitty/bin/adduser.py --course <SEMESTER> <COURSE> null <USERNAME>
This script will ask for more information about the user interactively.
Create registration section(s):
sudo su postgres psql -d submitty_<SEMESTER>_<COURSE> -c "insert into sections_registration(sections_registration_id) values(<SECTION>);"
NOTE: We intend to make a web UI to allow the instructor to create the registrations sections which will eliminate this as a sysadmin step in the future.
The instructor can add all other users (students, graders, other instructors) to the course by uploading a csv through the website.
Alternatively, students can be automatically added by connecting to data from the university registrar:
using registration data feed
Clean up Existing Course
If desired, delete course directory:
Note: Course directory can remain, which is useful for archive or plagiarism detection between semesters.
If desired, dump contents of course database as a backup:
FIXME: FILL IN THESE INSTRUCTIONS
Remove course database:
sudo su postgres psql -d postgres -c "DROP DATABASE submitty_<SEMESTER>_<COURSE>;"
It may be necessary to first cleanup connections:
sudo su postgres psql -d postgres -c "SELECT *, pg_terminate_backend(pid) FROM pg_stat_activity WHERE pid <> pg_backend_pid() AND datname = 'submitty_<SEMESTER>_<COURSE>';"
Remove the course and the association from all users to the course from the master database:
sudo su postgres psql -d submitty -c "DELETE FROM courses_users WHERE semester='<SEMESTER>' AND course='<COURSE>'; DELETE FROM courses WHERE semester='<SEMESTER>' AND course='<COURSE>';"