LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-11-2012, 10:56 PM   #1
magiknight
Member
 
Registered: Oct 2003
Posts: 37

Rep: Reputation: 4
According to the FHS where should function scripts be placed?


I have a question about where to properly place function scripts in the FHS? The functions to a package management tool I have forked reside in '/usr/share/pkgtool/' I have a problem with this, if /usr is not mounted (if its a separate partition or drive) then pkgtools would be useless in recovery or to fix a system (restore or remove packages). Any idea where to place them that would comply with the FHS? My original idea is to place the functions scripts in '/etc/pkgtools/lib' would this still be comply with with FHS? If not any idea's one where the best place to store these functions scripts would be?
 
Old 01-12-2012, 01:25 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

According to the FHS your scripts/programs should go under /usr. If /usr isn't mounted a lot more stuff will stop working. A lot of programs are saved in /usr. Following the FHS restricts /etc to static configuration files and may not contain binaries. But after all, it's your system, you can put them where you want but if you want to comply with FHS.... Another option which we use at work to put all our specific stuff is /opt, which according to FHS holds optional application software packages. We even save our configuration files there to have it all 'in one place'. You could put your stuff in /opt which would comply also with FHS in my opinion.

Kind regards,

Eric
 
Old 01-12-2012, 12:33 PM   #3
magiknight
Member
 
Registered: Oct 2003
Posts: 37

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by EricTRA View Post
Hi,

According to the FHS your scripts/programs should go under /usr. If /usr isn't mounted a lot more stuff will stop working. A lot of programs are saved in /usr. Following the FHS restricts /etc to static configuration files and may not contain binaries. But after all, it's your system, you can put them where you want but if you want to comply with FHS.... Another option which we use at work to put all our specific stuff is /opt, which according to FHS holds optional application software packages. We even save our configuration files there to have it all 'in one place'. You could put your stuff in /opt which would comply also with FHS in my opinion.

Kind regards,

Eric
I saw that, but if you look at /etc/init.d scripts they rely on functions that are in /etc.

As for /usr not being mounted problem, I am fixing that, I am moving some binaries to /bin and /sbin so that in the event that /usr may be a partition or a separate drive it will be possible to fix what is wrong with the OS in the event that drive damage or something might occur. So placing the functions in /usr/share/pkgtool is not really a good idea from that standpoint. Because if /usr is a mount and is unmountable there would be no way to fix the system if something did happen.

EDIT:
I found the answer I was looking for, according to the FHS /var/lib is used for variable data
but if you look under optional section you will find /var/lib/pkgtool and for is explanation it says "Packaging support files (optional)" well functions are support files for pkgtools so that is where they really belong. But this also has it's issues, because many people use a separate partition for this because it is very easy to fill up a hard drives full of logs and other variable data, preventing from a system to boot. I might have to use /opt

Last edited by magiknight; 01-12-2012 at 03:27 PM. Reason: SOLVED
 
Old 01-13-2012, 12:35 AM   #4
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

Good to hear you've found a possible solution. As you yourself indicated there are more possibilities, each and every one with their advantages and disadvantages. At the end it comes down to choices, the ones you make.

Kind regards,

Eric
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: FHS Refresh LXer Syndicated Linux News 0 05-06-2011 01:10 AM
[SOLVED] FHS Force de Grace Linux - Newbie 4 08-17-2010 06:48 AM
[SOLVED] Function for block commenting bash scripts in gedit idaham Linux - General 7 04-10-2010 03:46 PM
RedHat and FHS c0c0deuz Linux - General 4 11-08-2002 09:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration