How to Delete a Project From the /etc/project File
This example shows how to use the projdel command to delete a project.
Become superuser.
Remove the project booksite by using the projdel command.
# projdel booksite
Display the /etc/project file.
# cat /etc/project system:0:::: user.root:1:::: noproject:2:::: default:3:::: group.staff:10::::
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
Become superuser.
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.
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.
Become superuser.
Obtain the process ID of the book_catalog process.
# pgrep book_catalog 8100
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.
Confirm the task to process ID mapping.
# pgrep -T 17 8100