APLawrence - Information and Resources for Unix and Linux Systems, Bloggers and the self-employed
RSS Feeds Get APLawrence.com by RSS









SCO Skills Test

Copyright 2002,2003 A.P. Lawrence

Next
Previous
Return to Start Page
Get Complete 1007 Question Set

M

In the following session, root is unable to write to the important file because the tcl script has locked the file. However, all root would have to do is change permissions as shown and then the write would succeed.
# ksh
/tmp # l important lockit
-rwxrwSrw-   1 root     sys            0 Oct 12 12:37 important
-rwxr-xr-x   1 root     sys           82 Oct 12 12:37 lockit
/tmp # cat lockit
#!/bin/tcl
set my [ open important r+ ]
flock -write $my
set fred  [ gets stdin ]
/tmp # ./lockit &
[1]     911
[1] + Stopped (tty input)      ./lockit &
/tmp # date > important
ksh: important: cannot create
/tmp # chmod 766 important
/tmp # l important
-rwxrw-rw-   1 root     sys            0 Oct 12 12:37 important
/tmp # date > important

Answer

My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!


We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.