[news.software.b] 2 questions

root@sporty.UUCP (Super user) (02/04/91)

I have two questions (being new to news administration):
1.  Can anybody tell me what the following messages mean:

	From root Mon Feb  4 00:00:00 1991
	To: news
	Date: Mon Feb  4 00:00:00 1991

	df: /usr/spool not block special
	expr: syntax error
	/usr/lib/news/sendbatch: test: argument expected


	*************************************************
	Cron: The previous message is the standard output
      	and standard error of one of your cron commands.


	From root Mon Feb  4 02:00:01 1991
	To: news
	Date: Mon Feb  4 02:00:01 1991

	df: /usr/spool not block special


	*************************************************
	Cron: The previous message is the standard output
      	and standard error of one of your cron commands.


2.	 When you get a notice for a news group and you are set up
	to manually create them, how do you do it without sending
	control messages throughout all of creation?

E-mail responses are fine (jaa@rsch.oclc.org - or - 
sporty!jeff@ursa-major.spdcc.com)

Thanks!

tale@rpi.edu (David C Lawrence) (02/05/91)

In article <35@sporty.UUCP> root@sporty.UUCP (Super user) writes:

   1.  Can anybody tell me what the following messages mean:

           df: /usr/spool not block special
           expr: syntax error
           /usr/lib/news/sendbatch: test: argument expected

It means you're on a lame machine.  More specifically, your /usr/spool
is either not the root of a partition or if it is that your df
requires a /dev/PARTITION as an argument.  I suspect the latter.  The
other errors are probably coming from a variable not being set because
df tossed its cookies.

   2.	 When you get a notice for a news group and you are set up
           to manually create them, how do you do it without sending
           control messages throughout all of creation?

By using $NEWSBIN/maint/addgroup and ..../rmgroup.  It is useful to
have $NEWSBIN/maint in your news admin account PATH.
--
   (setq mail '("tale@cs.rpi.edu" "tale@ai.mit.edu" "tale@rpitsmts.bitnet"))

tale@rpi.edu (David C Lawrence) (02/05/91)

In article <+K%&_?$@rpi.edu> tale@rpi.edu (David C Lawrence) writes:

   In article <35@sporty.UUCP> root@sporty.UUCP (Super user) writes:

              /usr/lib/news/sendbatch: test: argument expected

John Palkovic has pointed out that this is a pretty good clue to a B
News system; imagine that, someone posting a B News question in
news.software.b.  I actually looked for sendbatch in my $NEWSBIN, too,
but assumed it not being there or not in $NEWSCTL was because I
removed it for my lack of UUCP connexions.

So, that make this bogus:

   By using $NEWSBIN/maint/addgroup and ..../rmgroup.  It is useful to
   have $NEWSBIN/maint in your news admin account PATH.

In B News, use inews -d local -C group.name to create a group,
possibly adding the moderated keyword if you need it.  Read the inews
manual page.  Also, B News has its own rmgroup command, I believe in
/usr/lib/news, which you should use for taking them out.  In the line
above, "rmgroup" was a blunder that I just noticed.  The C News script
which really takes them out is called delgroup in maint/.
--
   (setq mail '("tale@cs.rpi.edu" "tale@ai.mit.edu" "tale@rpitsmts.bitnet"))

bruce@balilly.UUCP (Bruce Lilly) (02/06/91)

In article <35@sporty.UUCP> sporty!jeff@ursa-major.spdcc.com(Jeff Anderson) writes:
>
>	df: /usr/spool not block special

Some (many?) versions of df require the arg to be a special device or mount
point. If /usr/spool is neither, such a message will result.

I hacked together a replacement for df which will accept any directory as
the arg.  The output format matches the df output as supplied for the
AT&T 3B1 (for some bizarre reason, C news thinks it's xenix!). Here it is,
no warranty.  If Henry and/or Geoff wish to include this in future C news
distributions, that's fine with me.  I modeled this after the AT&T SVR3+
man page, but it's incomplete (although entirely satisfactory for C news
use).  This must run suid root.

=======================================================================
/*	@(#)df.c	1.1	12/10/89	16:46:39	*/

#ifndef	lint
static	char	df_c_sccs_id[] = "@(#)df.c	1.1";
#endif

#include	<string.h>
#include	<sys/filsys.h>
#include	<sys/types.h>
#include	<sys/param.h>
#include	<sys/stat.h>
#include	<fcntl.h>
#include	<mnttab.h>
#include	<ustat.h>
#include	<stdio.h>

extern	char	*optarg;
extern	int	optind,	opterr;

enum	boolean	{false=0, true};

char	*opts = "ltf";
char	*mnttab = "/etc/mnttab";

void	usage(char	*prog)
{
	fprintf(stderr, "%s: usage: %s [-lt] [-f] [file system | directory | mounted-resource]\n", prog, prog);
}

main(int argc, char **argv)
{
	enum	boolean	total=false,	local=false,	freelist=false;
	int	c,	fd;
	struct	filsys	filsysbuf;
	struct	stat	statbuf,	statbuf2;
	struct	ustat	ustatbuf;
	struct	mnttab	mnttabbuf;
	char	device[sizeof(struct mnttab)/2+6];

	while((c = getopt(argc, argv, opts)) != -1)
		switch(c) {
		case 'l':	/*	local only	*/
			local=true;	/* doesn't matter for 3b1 */
		break;
		case 't':	/*	total	*/
			total = true;
		break;
		case 'f':	/*	free list count	*/
			freelist=true;
		break;
		default:	usage(argv[0]);
		break;
		}
	if((fd = open(mnttab, O_RDONLY)) < 0) {
		perror("open of mnttab");
		exit(__LINE__);
	}
	strcpy(device, "/dev/");
	if(optind == argc) {
		/* no args - do all mounted systems */
		while(read(fd, (char *)&mnttabbuf, sizeof(struct mnttab)) > 0) {
			if(stat(strcat(device, mnttabbuf.mt_dev), &statbuf) < 0) {
				perror("stat");
				fprintf(stderr, "tried to stat %s\n", device);
				exit(__LINE__);
			}
			if(ustat(statbuf.st_dev, &ustatbuf) < 0) {
				perror("ustat");
				exit(__LINE__);
			}
			printf("%-10s(%-10s): %8ld blocks %7u i-nodes\n", mnttabbuf.mt_filsys,
				device, ustatbuf.f_tfree, ustatbuf.f_tinode);
		}
	} else
		for(; optind < argc ; optind++) {	/*	args	*/
			if(stat(argv[optind], &statbuf) < 0) {
				perror("stat");
				fprintf(stderr, "tried to stat %s\n", argv[optind]);
				exit(__LINE__);
			}
			if(ustat(statbuf.st_dev, &ustatbuf) < 0) {
				perror("ustat");
				exit(__LINE__);
			}
			if(lseek(fd, 0, 0) < 0) {
				perror("rewind of mnttab file");
				exit(__LINE__);
			}
			while(read(fd, (char *)&mnttabbuf, sizeof(struct mnttab)) > 0) {
				if(stat(strcat(device, mnttabbuf.mt_dev), &statbuf2) < 0) {
					perror("stat");
					fprintf(stderr, "tried to stat %s\n", device);
					exit(__LINE__);
				}
				if(statbuf.st_dev == statbuf2.st_dev) {
					printf("%-10s(%-10s): %8ld blocks %7u i-nodes\n", mnttabbuf.mt_filsys,
						device, ustatbuf.f_tfree, ustatbuf.f_tinode);
					break;
				}
			}
		}
	close(fd);
	if(total) {
		if((fd = open(device, O_RDONLY)) < 0) {
			perror("open of device");
			exit(__LINE__);
		}
		if(lseek(fd, BSIZE, 0) < 0) {
			perror("seek to superblock");
			exit(__LINE__);
		}
		if(read(fd, (char *)&filsysbuf, sizeof(struct filsys)) <= 0) {
			perror("read of superblock");
			exit(__LINE__);
		}
		close(fd);
		printf("%22s: %8ld blocks %7u i-nodes\n", "total", filsysbuf.s_fsize*Fs2b,
			(filsysbuf.s_isize-2)*sizeof(ino_t)*8);
	}
	exit(0);
}
=======================================================================
--
	Bruce Lilly		blilly!balilly!bruce@sonyd1.Broadcast.Sony.COM