home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / linux / 22090 < prev    next >
Encoding:
Text File  |  1992-12-29  |  2.4 KB  |  63 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!gatech!destroyer!cs.ubc.ca!news.UVic.CA!sanjuan!pmacdona
  3. From: pmacdona@sanjuan (Peter MacDonald)
  4. Subject: Permissions in SLS
  5. Message-ID: <1992Dec29.214548.3694@sol.UVic.CA>
  6. Sender: news@sol.UVic.CA
  7. Nntp-Posting-Host: sanjuan.uvic.ca
  8. Organization: University of Victoria, Victoria, BC, CANADA
  9. Date: Tue, 29 Dec 92 21:45:48 GMT
  10. Lines: 51
  11.  
  12. Here is how I want to handle permission setting in SLS.
  13. Like just about all other administration, I want to use
  14. a shell script.  So I intend to modify/extend install
  15. to allow it to modify files in place, plus a few other
  16. goodies documented briefly below in the very simple
  17. example I cobbled together.
  18.  
  19. I intend to hook into rc.local to run this after the
  20. install is complete, and a reboot has occured.
  21. What I would like is feedback in the form of please 
  22. add the following lines ...
  23.  
  24. Here it is:
  25.  
  26. Peter
  27. ---perms.sh------------------------------------------------
  28. #
  29. # Set the permissions in the system using a modified install
  30. # adding option -i for in place mods of files, and allowing
  31. # character mode specs (u+r) like in chmod.  The -r option 
  32. # specifies recursive behaviour.  Also take multiple 
  33. # directories on the command line.  The advantage of a shell
  34. # script is that it allows extended semantics where needed.
  35. #
  36. install -d -o root -g root -m 755 bin
  37. install -d -o root -g root -m 755 usr
  38. install -d -o root -g root -m 755 lib
  39. install -d -o root -g root -m 755 home
  40. install -d -o root -g root -m 755 user
  41. install -d -o root -g root -m 755 mnt
  42. install -i -o root -g root -m 755 lib/*
  43. install -d -o root -g root -m 1777 tmp
  44. install -d -o root -g root -m 1777 usr/tmp
  45. install -d -o root -g root -m 755 usr/bin
  46. install -d -o root -g root -m 755 usr/lib
  47. install -r -i -o root -g root -m a+r usr/lib/*
  48. install -r -d -o root -g root -m a+rx usr/lib/*
  49. install -d -o root -g root -m 755 usr/man
  50. install -d -o root -g root -m 755 usr/man/*
  51. install -i -o root -g root -m 644 usr/man/*
  52. install -i -o root -g root -m 755 usr/man/*/*
  53. install -d -o root -g root -m 755 usr/spool
  54. install -d -o root -g root -m 755 usr/spool/mail
  55. install -d -o root -g root -m 755 usr/spool/uucp
  56. install -d -o root -g root -m 755 usr/adm
  57. for i in home/*; do
  58.     install -d -o `basename $i`  -g user -m 755 $i
  59.     install -i -o `basename $i`  -g user -m 755 $i/*
  60.     touch usr/spool/mail/`basename $i`
  61.     install -i -o `basename $i`  -g mail -m 660 usr/spool/mail/`basename $i`
  62. done
  63.