Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
6.  Projects and Tasks Project Administration Examples How to Define a Project and View the Current Project  Previous   Contents   Next 
   
 

How to Delete a Project From the /etc/project File

This example shows how to use the projdel command to delete a project.

  1. Become superuser.

  2. Remove the project booksite by using the projdel command.

    # projdel booksite
  3. Display the /etc/project file.

    # cat /etc/project
    system:0::::
    user.root:1::::
    noproject:2::::
    default:3::::
    group.staff:10::::
  4. Log in as user mark and type projects to view the projects that are assigned.
    # su - mark
    # projects
    default

How to Obtain User and Project Membership Information

Use the id command with the -p flag to view the current project membership of the invoking process.

$ id -p
uid=100(mark) gid=1(other) projid=3(default)

How to Create a New Task

  1. Become superuser.

  2. Create a new task in the booksite project by using the newtask command with the -v (verbose) option to obtain the system task ID.

    # newtask -v -p booksite
    16

    The execution of newtask creates a new task in the specified project, and places the user's default shell in this task.

  3. View the current project membership of the invoking process.

    # id -p
    uid=100(mark) gid=1(other) projid=4113(booksite)

    The process is now a member of the new project.

How to Move a Running Process Into a New Task

This example shows how to associate a running process with a different task and project. To perform this task, you must either be superuser, or be the owner of the process and be a member of the new project.

  1. Become superuser.

  2. Obtain the process ID of the book_catalog process.

    # pgrep book_catalog
    	8100
  3. Associate process 8100 with a new task ID in the booksite project.

    # newtask -v -p booksite -c 8100
    	17

    The -c option specifies that newtask operate on the existing named process.

  4. Confirm the task to process ID mapping.

    # pgrep -T 17
    	8100
 
 
 
  Previous   Contents   Next