Skip to content

Commit

Permalink
Update default locations of blahp files.
Browse files Browse the repository at this point in the history
Assume files are under /usr if no other guidance is given. Also, if the
libexec directory has a 'blahp' subdirectory, assume the blahp's libexec
files are there.
  • Loading branch information
JaimeFrey committed Jul 29, 2021
1 parent 7325234 commit f9a1795
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/blahpd.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@

#define RCSID_VERSION "$GahpVersion: %s Mar 31 2008 INFN\\ blahpd\\ (%s) $"

#define DEFAULT_GLITE_LOCATION "/opt/glite"
#define DEFAULT_GLEXEC_COMMAND "/opt/glite/sbin/glexec"
#define DEFAULT_GLITE_LOCATION "/usr"
#define DEFAULT_GLEXEC_COMMAND "/usr/sbin/glexec"
#define DEFAULT_SUDO_COMMAND "/usr/bin/sudo"

/* Change this in order to select the default batch system
Expand Down
18 changes: 16 additions & 2 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ config_read(const char *ipath)
FILE *test;
int file_cnt;
struct dirent **file_list = NULL;
DIR *test_dir = NULL;
char full_file[PATH_MAX];
int i;
struct passwd *pwd = NULL;
Expand Down Expand Up @@ -235,8 +236,21 @@ config_read(const char *ipath)
}
else
{
rha->libexec_path = (char *)malloc(strlen(install_location)+9);
if (rha->libexec_path != NULL) sprintf(rha->libexec_path,"%s/libexec",install_location);
/* If libexec has a 'blahp' subdirectory, then the blahp files should
* be in there.
*/
rha->libexec_path = (char *)malloc(strlen(install_location)+15);
if (rha->libexec_path != NULL)
{
sprintf(rha->libexec_path,"%s/libexec/blahp",install_location);
test_dir = opendir(rha->libexec_path);
if (test_dir == NULL)
{
sprintf(rha->libexec_path,"%s/libexec",install_location);
} else {
closedir(test_dir);
}
}
}
if (rha->libexec_path == NULL)
{
Expand Down
7 changes: 6 additions & 1 deletion src/scripts/blah_load_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,13 @@ elif [ -d "${GLITE_LOCATION:-/opt/glite}/libexec" ]; then
else
blah_libexec_directory="/usr/libexec"
fi
# If the libexec directory has a 'blahp' subdirectory, then the blahp
# files should be there.
if [ -d "${blah_libexec_directory}/blahp" ]; then
blah_libexec_directory="${blah_libexec_directory}/blahp"
fi

# Let blah_bin_directory be overridden in the config file.
# Let blah_{bin|sbin|libexec}_directory be overridden in the config file.

config_file=/etc/blah.config
if [ -r "$BLAHPD_CONFIG_LOCATION" ]; then
Expand Down

0 comments on commit f9a1795

Please sign in to comment.