Thread overview | |||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
May 11, 2003 dmd.conf | ||||
---|---|---|---|---|
| ||||
I think in the Linux version the configuration file dmd.conf should not go with the executable because this isn't the Unix way to do it (there seems to be no reliable way to get at the path of the executable) ... ... but be searched at /etc/dmd.conf You can always have the original in the installation directory and put a symbolic link at /etc, for example: cd /etc ln -s /home/leitner/d/dmd/bin/dmd.conf -- Helmut Leitner leitner@hls.via.at Graz, Austria www.hls-software.com |
May 11, 2003 Re: dmd.conf | ||||
---|---|---|---|---|
| ||||
Posted in reply to Helmut Leitner | "Helmut Leitner" <helmut.leitner@chello.at> wrote in message news:3EBE0A90.F5EC470A@chello.at... > I think in the Linux version the configuration file dmd.conf should not go with the executable because this isn't the Unix way to do it (there seems to be no reliable way to get at the path of the executable) ... argv[0] doesn't do it? |
May 11, 2003 Re: dmd.conf | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Walter wrote: > > "Helmut Leitner" <helmut.leitner@chello.at> wrote in message news:3EBE0A90.F5EC470A@chello.at... > > I think in the Linux version the configuration file dmd.conf should not go with the executable because this isn't the Unix way to do it (there seems to be no reliable way to get at the path of the executable) ... > > argv[0] doesn't do it? I don't think so: leitner@linux:~/d/dmd/samples/d> hello hello world args.length = 1 args[0] = 'hello' This is even the case, when the program is called from a script and the directory is looked up from the PATH. While you can usually rely on args[0] in the DOS/Windows world, I think you usually can't in the Unix world. -- Helmut Leitner leitner@hls.via.at Graz, Austria www.hls-software.com |
May 11, 2003 Re: dmd.conf | ||||
---|---|---|---|---|
| ||||
Posted in reply to Helmut Leitner | "Helmut Leitner" <helmut.leitner@chello.at> wrote in message news:3EBEA3FA.CAD63F57@chello.at... > Walter wrote: > > "Helmut Leitner" <helmut.leitner@chello.at> wrote in message news:3EBE0A90.F5EC470A@chello.at... > > > I think in the Linux version the configuration file dmd.conf should not go > > > with the executable because this isn't the Unix way to do it (there seems > > > to be no reliable way to get at the path of the executable) ... > > argv[0] doesn't do it? > I don't think so: > leitner@linux:~/d/dmd/samples/d> hello > hello world > args.length = 1 > args[0] = 'hello' > This is even the case, when the program is called from a script > and the directory is looked up from the PATH. > While you can usually rely on args[0] in the DOS/Windows world, > I think you usually can't in the Unix world. <rant> I occaisionally run into these frustrating lacks in linux - frustrating because they'd be so easy to add to the kernel, and are so unreliable to try and work around. One thing I wanted to avoid with linux is having a dmd installation spew files all over the system. It looks like it's going to be very hard avoiding this. </rant> There, I feel better now <g>. |
May 11, 2003 Re: dmd.conf | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Walter wrote:
> <rant>
> I occaisionally run into these frustrating lacks in linux - frustrating
> because they'd be so easy to add to the kernel, and are so unreliable to try
> and work around. One thing I wanted to avoid with linux is having a dmd
> installation spew files all over the system. It looks like it's going to be
> very hard avoiding this.
> </rant>
>
> There, I feel better now <g>.
>
Spewing files all over the system is the Unix way!
|
May 11, 2003 Re: dmd.conf | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andy Friesen | "Andy Friesen" <andy@ikagames.com> wrote in message news:b9mka7$8g6$1@digitaldaemon.com... > Walter wrote: > > <rant> > > I occaisionally run into these frustrating lacks in linux - frustrating > > because they'd be so easy to add to the kernel, and are so unreliable to try > > and work around. One thing I wanted to avoid with linux is having a dmd installation spew files all over the system. It looks like it's going to be > > very hard avoiding this. > > </rant> > > There, I feel better now <g>. > Spewing files all over the system is the Unix way! It's the Windows way, too, but I had figured out a way to avoid it! |
May 11, 2003 Re: dmd.conf | ||||
---|---|---|---|---|
| ||||
Posted in reply to Helmut Leitner | "Helmut Leitner" <helmut.leitner@chello.at> wrote in message news:3EBE0A90.F5EC470A@chello.at... > I think in the Linux version the configuration file dmd.conf should not go with the executable because this isn't the Unix way to do it (there seems to be no reliable way to get at the path of the executable) ... > > ... but be searched at > > /etc/dmd.conf Why /etc instead of, say, /usr/local/etc? (Pardon my ignorance of linux conventions.0 |
May 12, 2003 Re: dmd.conf | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andy Friesen | In article <b9mka7$8g6$1@digitaldaemon.com>, Andy Friesen says... > >Walter wrote: >> <rant> >> I occaisionally run into these frustrating lacks in linux - frustrating >> because they'd be so easy to add to the kernel, and are so unreliable to try >> and work around. One thing I wanted to avoid with linux is having a dmd >> installation spew files all over the system. It looks like it's going to be >> very hard avoiding this. >> </rant> >> >> There, I feel better now <g>. >> > >Spewing files all over the system is the Unix way! There are documets on where the different files of an application should be put in a Linux or Unix system. (Sorry, right now I can't give a pointer. Anybody?) You might also check the Vim editor sources (www.vim.org), Vim does a good job of "knowing where it is", among other things. The volume where the compiler binaries reside might be remotely mounted as read-only, especially in a corporate setup. Also, it is easier for the sysadmin to have all system-wide configurations in the same place, i.e. /etc. Individual users can then override these configurations, e.g. with a $HOME/.dmd file (or even directory, if the configuration is elaborate -- which probably is not needed fof dmd.) One way to resolve the issue is to have the binary look for the config file in /etc and read it, then to update the parameters reading from the first config file found in 1. defined on the command line 2. pointed to by the environment variable $DMD_CONFIG, if it is defined 3. current directory (.) 4. home directory ($HOME) If the user installing DMD is root then this is what sould be set up. On the other hand, if the installing user is non-root (the user himself), then the installation should copy a default .dmd file to his home directory. In this case the .dmd file could contain the path to dmd-home, since the user might have installed the package in any of various places. (It's not even uncommon to install in /tmp, for example for temporary needs or to just check something.) In any case, you probably have to spew a man-file to the man directory, the libraries to /usr/lib, the binary to /usr/bin, and the config file to /etc, at the very least. Sure, it is possible to have the whole DMD-tree in one place. This is OK for a personal install. But when root installs DMD, then every user should be able to use DMD, and then a single-hierarchy-install would confuse normal Unix and Linux people. |
May 12, 2003 Re: dmd.conf | ||||
---|---|---|---|---|
| ||||
Posted in reply to Georg Wrede | Some good ideas here. Thanks! "Georg Wrede" <Georg_member@pathlink.com> wrote in message news:b9mp6d$d59$1@digitaldaemon.com... > In article <b9mka7$8g6$1@digitaldaemon.com>, Andy Friesen says... > > > >Walter wrote: > >> <rant> > >> I occaisionally run into these frustrating lacks in linux - frustrating > >> because they'd be so easy to add to the kernel, and are so unreliable to try > >> and work around. One thing I wanted to avoid with linux is having a dmd installation spew files all over the system. It looks like it's going to be > >> very hard avoiding this. > >> </rant> > >> > >> There, I feel better now <g>. > >> > > > >Spewing files all over the system is the Unix way! > > There are documets on where the different files of an application should be put > in a Linux or Unix system. (Sorry, right now I can't give a pointer. Anybody?) > You might also check the Vim editor sources (www.vim.org), Vim does a good job > of "knowing where it is", among other things. > > The volume where the compiler binaries reside might be remotely mounted as read-only, especially in a corporate setup. Also, it is easier for the sysadmin > to have all system-wide configurations in the same place, i.e. /etc. > > Individual users can then override these configurations, e.g. with a $HOME/.dmd > file (or even directory, if the configuration is elaborate -- which probably is > not needed fof dmd.) > > One way to resolve the issue is to have the binary look for the config file in > /etc and read it, then to update the parameters reading from the first config > file found in > > 1. defined on the command line > 2. pointed to by the environment variable $DMD_CONFIG, if it is defined > 3. current directory (.) > 4. home directory ($HOME) > > If the user installing DMD is root then this is what sould be set up. On the > other hand, if the installing user is non-root (the user himself), then the > installation should copy a default .dmd file to his home directory. In this case > the .dmd file could contain the path to dmd-home, since the user might have > installed the package in any of various places. (It's not even uncommon to install in /tmp, for example for temporary needs or to just check something.) > > In any case, you probably have to spew a man-file to the man directory, the > libraries to /usr/lib, the binary to /usr/bin, and the config file to /etc, at > the very least. > > Sure, it is possible to have the whole DMD-tree in one place. This is OK for a > personal install. But when root installs DMD, then every user should be able to > use DMD, and then a single-hierarchy-install would confuse normal Unix and Linux > people. > > |
May 12, 2003 Re: dmd.conf | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter |
Walter wrote:
>
> "Helmut Leitner" <helmut.leitner@chello.at> wrote in message news:3EBE0A90.F5EC470A@chello.at...
> > I think in the Linux version the configuration file dmd.conf should not go with the executable because this isn't the Unix way to do it (there seems to be no reliable way to get at the path of the executable) ...
> >
> > ... but be searched at
> >
> > /etc/dmd.conf
>
> Why /etc instead of, say, /usr/local/etc? (Pardon my ignorance of linux conventions.0
Sorry, I can't answer the question. I'm still a 90% Windows developer.
I only notice that all applications that I installed (apache, exim, ...)
put their config files into /etc. It's the place where people look first.
--
Helmut Leitner leitner@hls.via.at Graz, Austria www.hls-software.com
|
Copyright © 1999-2021 by the D Language Foundation