Moved semafore directory to ~/var/sema

This commit is contained in:
Michiel Broek 2004-09-14 20:37:57 +00:00
parent d9c5d0eb54
commit eb1e9a6fe9
21 changed files with 46 additions and 37 deletions

View File

@ -18,6 +18,8 @@ v0.61.4 11-Aug-2004
change the setup of these nodes in screen 7.10.
Run "mbfile check" and then "mbfile index". This fixes the
thumbnails if supported by your system.
Update all maintenance scripts to change the semafore directory
to ~/var/sema.
libmbse.a:
The socket_connect function now sets the global nodenumber from
@ -85,6 +87,12 @@ v0.61.4 11-Aug-2004
count of tty line records so the used nodenumbers will be a lot
lower then before.
Changed Msg_Read from 78 to 79 characters.
In menu the semafore directory was scanned direct instead of
using the library functions.
mbstat:
In the wait function the semafore directory was scanned direct
instead of using the library functions.
mbnewusr:
During program exit, it tried to remove the wrong socket to
@ -98,8 +106,9 @@ v0.61.4 11-Aug-2004
was on hold.
The comm protocol reply to the AINI command now contains a fake
node number.
The magic filenames directory is move from ~/magic to
The magic filenames directory is moved from ~/magic to
~/var/magic.
The semafore directory is moved from ~/sema to ~/var/sema.
mbsetup:
Changed nodes screens to have a separate uplink managers setup
@ -107,13 +116,16 @@ v0.61.4 11-Aug-2004
If the convert program is found and was not found before, the
defaults are set in menu 1.15.6.
The files database is moved from ~/fdb to ~/var/fdb.
The magic filenames directory is move from ~/magic to
The magic filenames directory is moved from ~/magic to
~/var/magic.
The semafore directory is moved from ~/sema to ~/var/sema.
script:
In the editor script (that calls joe) made a fix for screens
wider then 80 characters. Also fixed the joe path if it should
run in emacs mode. Added FromAddress in the header.
Changed all init and maint scripts to move the semafore
directory from ~/sema to ~/var/sema.
v0.61.3 25-Jul-2004 - 11-Aug-2004

View File

@ -53,7 +53,6 @@ install:
@${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/share/doc/html
@${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/share/doc/tags
@${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0770 ${PREFIX}/log
@${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0777 ${PREFIX}/sema
@${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0770 ${PREFIX}/tmp
@${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0770 ${PREFIX}/home
@${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0770 ${PREFIX}/dutch
@ -117,6 +116,7 @@ install:
@${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/var/queue
@${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0770 ${PREFIX}/var/rules
@${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0770 ${PREFIX}/var/run
@${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0777 ${PREFIX}/var/sema
@${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/var/ticqueue
@${INSTALL} -d -o ${OWNER} -g ${GROUP} -m 0750 ${PREFIX}/var/unknown
@if [ -x ${BINDIR}/mbtelnetd ]; then \
@ -128,6 +128,8 @@ install:
echo; echo "If there is nothing important in ${PREFIX}/doc" ; \
echo "you may remove that obsolete directory." ; \
fi
@rm -rf ${PREFIX}/sema
dist tar: ${TARFILE}

View File

@ -62,7 +62,6 @@ layout looks like this:<br>
/opt/mbse/italian/menus 0750 Italian menu files
/opt/mbse/italian/txtfiles 0770 Italian ANSI files
/opt/mbse/log 0770 MBSE BBS logfiles
/opt/mbse/sema 0777 Semafore files
/opt/mbse/share/doc 0750 Generated sitedocs
/opt/mbse/share/doc/html 0750 Generated html sitedocs
/opt/mbse/share/doc/tags 0750 Generated area tags
@ -88,6 +87,7 @@ layout looks like this:<br>
/opt/mbse/var/queue 0750 Queue for before outbound
/opt/mbse/var/rules 0770 Echomail area rules files
/opt/mbse/var/run 0770 Pid files of running programs
/opt/mbse/var/sema 0777 Semafore files
/opt/mbse/var/ticqueue 0750 Queue for TIC files
/opt/mbse/var/unknown 0750 Unprotected inbound directory
</pre>

View File

@ -174,7 +174,7 @@ something to send. For example like this:
<pre>
ln -s /opt/mbse/var/msgs /opt/mbse/var/dosemu/c/msgs
ln -s /opt/mbse/var/boxes/node92_100_60 /opt/mbse/var/dosemu/c/outbox
ln -s /opt/mbse/sema /opt/mbse/var/dosemu/c/sema
ln -s /opt/mbse/var/sema /opt/mbse/var/dosemu/c/sema
</pre>
In dos you now have:
<pre>

View File

@ -16,7 +16,7 @@
<body>
<blockquote>
<div align="Center"><h1>MBSE BBS FAQ and Howto.</h1></div>
<div align="Right"><h5>Last updated 11-Aug-2004</h5></div>
<div align="Right"><h5>Last updated 14-Sep-2004</h5></div>
<pre>
Authors: P.E. Kimble aka King Kimerud kimerud@bayhaus.org
@ -570,7 +570,7 @@ do
i=60;
while let 'i &gt; 0' &amp;&amp; let 'connect == 0'
do
if [ -f $MBSE_ROOT/sema/is_inet ]; then
if [ -f $MBSE_ROOT/var/sema/is_inet ]; then
connect=1
echo "mbtask detected internet" | $LOGGER
fi
@ -580,7 +580,7 @@ do
#
# Check if we have a connection
#
if [ ! -f $MBSE_ROOT/sema/is_inet ]; then
if [ ! -f $MBSE_ROOT/var/sema/is_inet ]; then
echo "Failed, 10 seconds pause ..." | $LOGGER
sleep 10
fi
@ -598,7 +598,7 @@ $MBSE_ROOT/bin/mbout poll f5003.n280.z2 f19.n280.z2 -quiet
i=25;
while let 'i &gt; 0'
do
if [ -f $MBSE_ROOT/sema/do_inet ]; then
if [ -f $MBSE_ROOT/var/sema/do_inet ]; then
i=0;
else
let i=i-1;
@ -614,7 +614,7 @@ done
i=3600;
while let 'i &gt; 0'
do
if [ ! -f $MBSE_ROOT/sema/do_inet ]; then
if [ ! -f $MBSE_ROOT/var/sema/do_inet ]; then
i=0;
else
let i=i-1;

View File

@ -14,11 +14,11 @@
</HEAD>
<BODY>
<BLOCKQUOTE>
<div align='right'><h5>Last update 21-Feb-2002</h5></div>
<div align='right'><h5>Last update 14-Sep-2004</h5></div>
<div align='center'><H1>Semafore files with MBSE BBS.</H1></div>
The directory $MBSE_ROOT/sema is the hardcoded semafore directory where all
The directory $MBSE_ROOT/var/sema is the hardcoded semafore directory where all
semafore's must be created, tested and removed. When the system is booting,
the init script will erase all semafore's just before the BBS is started.
This description is valid from MBSE BBS v0.33.19 and newer.

View File

@ -246,8 +246,7 @@ int Wait(void)
int Waiting = 3600;
char buf[PATH_MAX];
sprintf(buf, "%s/sema/upsdown", getenv("MBSE_ROOT"));
if (file_exist(buf, R_OK) == 0)
if (IsSema((char *)"upsdown"))
Waiting = 30;
Syslog('+', "Waiting for the BBS to become free, timeout %d seconds", Waiting);

View File

@ -89,7 +89,7 @@ void menu()
{
FILE *pMenuFile;
int iFoundKey = FALSE, Key, IsANSI;
char *Input, *Semfile, *sMenuPathFileName, buf[81];
char *Input, *sMenuPathFileName, buf[81];
Input = calloc(PATH_MAX, sizeof(char));
sMenuPathFileName = calloc(PATH_MAX, sizeof(char));
@ -175,17 +175,13 @@ void menu()
/*
* Check the upsdown semafore
*/
Semfile = calloc(PATH_MAX, sizeof(char));
sprintf(Semfile, "%s/sema/upsdown", getenv("MBSE_ROOT"));
if (file_exist(Semfile, R_OK) == 0) {
if (IsSema((char *)"upsdown")) {
fclose(pMenuFile);
Syslog('+', "Kicking user out, upsdown semafore detected");
printf("System power failure, closing the bbs\n\n");
free(Semfile);
sleep(3);
Good_Bye(MBERR_OK);
}
free(Semfile);
/*
* Check if SysOp wants to chat to user everytime user gets prompt.

View File

@ -125,8 +125,8 @@ static void die(int onsig)
fprintf(fp, "JAMHARDDELETE NO\n\n");
fprintf(fp, "; Semaphore files\n;\n");
fprintf(fp, "SEMAPHORE NETSCAN %s/sema/mailout\n", getenv("MBSE_ROOT"));
fprintf(fp, "SEMAPHORE ECHOSCAN %s/sema/mailout\n\n", getenv("MBSE_ROOT"));
fprintf(fp, "SEMAPHORE NETSCAN %s/var/sema/mailout\n", getenv("MBSE_ROOT"));
fprintf(fp, "SEMAPHORE ECHOSCAN %s/var/sema/mailout\n\n", getenv("MBSE_ROOT"));
gold_areas(fp);
}

View File

@ -265,7 +265,7 @@ void CreateSema(char *sem)
char temp[PATH_MAX];
int fd;
sprintf(temp, "%s/sema/%s", getenv("MBSE_ROOT"), sem);
sprintf(temp, "%s/var/sema/%s", getenv("MBSE_ROOT"), sem);
if (access(temp, F_OK) == 0)
return;
if ((fd = open(temp, O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP)) >= 0)
@ -281,7 +281,7 @@ void TouchSema(char *sem)
char temp[PATH_MAX];
int fd;
sprintf(temp, "%s/sema/%s", getenv("MBSE_ROOT"), sem);
sprintf(temp, "%s/var/sema/%s", getenv("MBSE_ROOT"), sem);
if ((fd = open(temp, O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP)) >= 0) {
close(fd);
} else
@ -294,7 +294,7 @@ void RemoveSema(char *sem)
{
char temp[PATH_MAX];
sprintf(temp, "%s/sema/%s", getenv("MBSE_ROOT"), sem);
sprintf(temp, "%s/var/sema/%s", getenv("MBSE_ROOT"), sem);
if (access(temp, F_OK))
return;
if (unlink(temp) == -1)
@ -307,7 +307,7 @@ int IsSema(char *sem)
{
char temp[PATH_MAX];
sprintf(temp, "%s/sema/%s", getenv("MBSE_ROOT"), sem);
sprintf(temp, "%s/var/sema/%s", getenv("MBSE_ROOT"), sem);
return (access(temp, F_OK) == 0);
}

View File

@ -32,7 +32,7 @@ case "$1" in
start)
echo -n "Starting $DESC: "
rm -f $MBSE_ROOT/var/run/*
rm -f $MBSE_ROOT/sema/*
rm -f $MBSE_ROOT/var/sema/*
rm -f $MBSE_ROOT/var/*.LCK
rm -f $MBSE_ROOT/tmp/mb*
su mbse -c '$MBSE_ROOT/bin/mbtask' >/dev/null

View File

@ -28,7 +28,7 @@ export MBSE_ROOT
case "$1" in
start)
rm -f ${MBSE_ROOT}/var/run/*
rm -f ${MBSE_ROOT}/sema/*
rm -f ${MBSE_ROOT}/var/sema/*
rm -f ${MBSE_ROOT}/var/*.LCK
rm -f ${MBSE_ROOT}/tmp/mb*
su mbse -c '${MBSE_ROOT}/bin/mbtask' >/dev/null

View File

@ -35,7 +35,7 @@ start() {
ebegin "Starting mbse"
rm -f ${MBSE_ROOT}/var/run/*
rm -f ${MBSE_ROOT}/sema/*
rm -f ${MBSE_ROOT}/var/sema/*
rm -f ${MBSE_ROOT}/var/*.LCK
rm -f ${MBSE_ROOT}/tmp/mb*
su mbse -c '${MBSE_ROOT}/bin/mbtask' >/dev/null

View File

@ -40,7 +40,7 @@ mbsebbs_start()
export MBSE_ROOT
rm -f ${MBSE_ROOT}/var/run/*
rm -f ${MBSE_ROOT}/sema/*
rm -f ${MBSE_ROOT}/var/sema/*
rm -f ${MBSE_ROOT}/var/*.LCK
rm -f ${MBSE_ROOT}/tmp/mb*
su mbse -c '${MBSE_ROOT}/bin/mbtask' >/dev/null 2>&1

View File

@ -39,7 +39,7 @@ case "$1" in
start)
echo -n "Starting MBSE BBS: "
rm -f ${MBSE_ROOT}/var/run/*
rm -f ${MBSE_ROOT}/sema/*
rm -f ${MBSE_ROOT}/var/sema/*
rm -f ${MBSE_ROOT}/var/*.LCK
rm -f ${MBSE_ROOT}/tmp/mb*
su - mbse -c '${MBSE_ROOT}/bin/mbtask' >/dev/null

View File

@ -29,7 +29,7 @@ case "$1" in
start)
echo -n "MBSE BBS starting:"
rm -f ${MBSE_ROOT}/var/run/*
rm -f ${MBSE_ROOT}/sema/*
rm -f ${MBSE_ROOT}/var/sema/*
rm -f ${MBSE_ROOT}/var/*.LCK
rm -f ${MBSE_ROOT}/tmp/mb*
su mbse -c '${MBSE_ROOT}/bin/mbtask' >/dev/null

View File

@ -32,7 +32,7 @@ case "$1" in
start)
echo -n "MBSE BBS starting:"
rm -f ${MBSE_ROOT}/var/run/*
rm -f ${MBSE_ROOT}/sema/*
rm -f ${MBSE_ROOT}/var/sema/*
rm -f ${MBSE_ROOT}/var/*.LCK
rm -f ${MBSE_ROOT}/tmp/mb*
su mbse -c '${MBSE_ROOT}/bin/mbtask' >/dev/null

View File

@ -14,7 +14,7 @@ fi
# Don't do maintenance if running on UPS battery power.
#
if [ -f $MBSE_ROOT/sema/upsalarm ]; then
if [ -f $MBSE_ROOT/var/sema/upsalarm ]; then
exit 0
fi

View File

@ -14,7 +14,7 @@ fi
# While the system is on UPS battery power, don't start maintenance
#
while [ -f $MBSE_ROOT/sema/upsalarm ]; do
while [ -f $MBSE_ROOT/var/sema/upsalarm ]; do
sleep 60
done

View File

@ -14,6 +14,6 @@ fi
# While the system is on UPS battery power, don't start maintenance
#
while [ -f $MBSE_ROOT/sema/upsalarm ]; do
while [ -f $MBSE_ROOT/var/sema/upsalarm ]; do
sleep 60
done

View File

@ -14,7 +14,7 @@ fi
# While the system is on UPS battery power, don't start maintenance
#
while [ -f $MBSE_ROOT/sema/upsalarm ]; do
while [ -f $MBSE_ROOT/var/sema/upsalarm ]; do
sleep 60
done