UNIX Users and Groups

  1. Create local user accounts for the instructor and TAs for this course:

  2. 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

    addgroup <COURSE>_archive

    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.

  3. Add the instructors into the course groups:

    adduser instructor <COURSE>
    adduser instructor <COURSE>_tas_www
    adduser instructor <COURSE>_archive
  4. Add the TAs into the course group:

    adduser ta <COURSE>_tas_www
  5. Add special users hwphp, hwcron, and hwcgi to the <COURSE>_tas_www group:

    adduser hwphp <COURSE>_tas_www
    adduser hwcron <COURSE>_tas_www
    adduser hwcgi <COURSE>_tas_www

    NOTE: After adding the hwphp user to a new course group, you’ll need to restart fpm to ensure that the webpage sees the change:

    sudo service php7.0-fpm restart   
  6. Give permissions to create new users and update apache configurations

    Add the instructor (and head TA) to the course_builders group:

       adduser instructor course_builders
  7. OPTIONAL: It has been helpful to create a dummy student account for each instructor for testing purposes (e.g. doej-stu).

    adduser instructor-stu

Prepare the course directory and course database

  1. If the top level submitty database does not exist, that must be created first. For more information: Database Overview

  2. 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 smithj and TA group <COURSE>_tas_www.

    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 hwphp, hwcron, and hwcgi. Also the instructor must be part of the course_builders group.

    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 submitty_<SEMESTER>_<COURSE>:

    sudo su postgres
    \c submitty_<SEMESTER>_<COURSE>

    For more information: Database Overview

  3. 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.

  4. Create registration section(s):

    sudo su postgres
    psql -d submitty_<SEMESTER>_<COURSE> -c "insert into sections_registration(sections_registration_id) values(<SECTION>);"

    (replacing <SEMESTER>, <COURSE>, and <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.

  5. 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

  1. If desired, delete course directory:

    rm /var/local/submitty/courses/<SEMESTER>/<COURSE>

    Note: Course directory can remain, which is useful for archive or plagiarism detection between semesters.

  2. If desired, dump contents of course database as a backup:


  3. 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>';"
  4. 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>';"