Skip to contentSkip to conversation

mlmmj on Solaris

DISCUSSION Morten K. Poulsen 2 participants 4 messages Sep 25, 2006 – Sep 26, 2006

lore
Share & tools
lore
#0 lore raw

Hi Rob,

I am sending the reply with CC to the list. I hope that's OK.

Quoted 1 line · Rob Shepherd

First, thanks for mlmmj. Neat.

You're welcome :)

Quoted 2 lines

I have some notes regarding my recent experience with building mlmmj on Solaris 10.

Nice. I think you're the first to do that. Do you know if it is possible to get a shell account on a Solaris box anywhere, to test the next mlmmj release?

Quoted 4 lines

1.

	CFLAGS="-D_POSIX_PTHREAD_SEMANTICS"

	...is required.

That is very strange. Mlmmj does not use threads or any kind of pthread library feature. What happens if you compile without?

Quoted 5 lines

2.
/bin/sh in Solaris is Posix shell and is much more strict than /bin/sh
on linux (which i think is just bash). mlmmj-make-ml.sh needs..

	#!/bin/bash

Which features of bash are needed in the script now? Would it be possible to change it to not use those features?

Quoted 9 lines

3.
If mlmmj-maintd is not in the path, which does something different to
what you might expect.

[08:58:18][root@zorch-mail:/usr/local/mlmmj/bin]$ which mlmmj-maintd
no mlmmj-maintd in /usr/sbin /usr/bin /opt/csw/bin /opt/csw/gcc3/bin
/usr/ccs/bin /opt/SUNWspro/bin
	I added the ${prefix}/bin to the PATH at start of mlmmj-make-ml.sh

Hmmm, I guess the binaries should be found via a autoconf(?) variable like @textlibdir@. Would that work? Henne?

Quoted 9 lines

4.
Aliases. I use a seperate aliases file /usr/local/mlmmj/etc/aliases.
The form for this alias file, when used with postfix at least, does not use a ': ' seperator, rather just white space. I have adjusted my make-mlmmj-ml.sh. Another reason for using a seperate aliases file is that postfix (2.2.10 at least) is able to perform the spooling or command pipe with the uid of the aliases file. On solaris the user smmsp always exists, even if sendmail is not installed. I may then do...

Quoted 4 lines

chown smmsp:smmsp /usr/local/mlmmj/etc/aliases
chown -R smmsp:smmsp /var/spool/mlmmj

...and it runs as smmsp.

That is a nice feature. Perhaps the script could check the mailer, and write a seperate alias file if it is supported. A patch would be appreciated ;)

Quoted 1 line

Other than that, It's great. Keep up the good work.

Thanks :)

Quoted 1 line

Feel free to put my notes in a README.Solaris or whatever.

I will, if we can't find good solutions for the (few) issues. The thing about Postfix and separate alias file - will that work on any operating system?

Morten

Signature · 2 lines
Morten K. Poulsen <[email protected]>
http://www.afdelingp.dk/
#1 lore raw

Hi Rob,

Quoted 6 lines · Rob Shepherd
Quoted 3 lines · Morten K. Poulsen

Nice. I think you're the first to do that. Do you know if it is possible to get a shell account on a Solaris box anywhere, to test the next mlmmj release?

Yes. I'll see what I can do.

Cool, thanks.

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

1.

	CFLAGS="-D_POSIX_PTHREAD_SEMANTICS"

	...is required.
Quoted 7 lines
Quoted 1 line

That is very strange. Mlmmj does not use threads or any kind of pthread

library feature. What happens if you compile without?

It's nothing to do with threads, rather Solaris compatability issues.

log_oper.c: In function `log_oper':
log_oper.c:76: error: too few arguments to function `ctime_r'

Ah, ok. We could change ctime_r to ctime, as we are not using threads. The Solaris version of ctime_r requires a buflen paremeter - not POSIX compliant.

Quoted 10 lines
Quoted 7 lines
Quoted 5 lines

2.
/bin/sh in Solaris is Posix shell and is much more strict than /bin/sh
on linux (which i think is just bash). mlmmj-make-ml.sh needs..

	#!/bin/bash

Which features of bash are needed in the script now? Would it be

possible to change it to not use those features?

it fails first with 'let', don't know after that. I switched to bash.

Ok, any shell scripting gurus on the list? :)

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

3.
If mlmmj-maintd is not in the path, which does something different to
what you might expect.

[snip]

Quoted 4 lines
Quoted 2 lines

Hmmm, I guess the binaries should be found via a autoconf(?) variable like @textlibdir@. Would that work? Henne?

I'll let you figure that one out. :)

Ok, any autoconf gurus on the list? :)

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

4.
Aliases. I use a seperate aliases file /usr/local/mlmmj/etc/aliases.

[snip]

Quoted 3 lines
Quoted 3 lines

That is a nice feature. Perhaps the script could check the mailer, and write a seperate alias file if it is supported. A patch would be appreciated ;)

[snip]

Quoted 2 lines

I dislike user scripts which attempt to guess the environment and do what is best for the creator as opposed to the user.

[snip]

Quoted 10 lines

I guess, the compile time options...

--with-postfix-alias-file=%path/to/alias/file%

will set the "lack of" ':' in the alias file, it's location and the fact that the user wants the make script to write it for him/her.

--with-postfix-alias-user=%uid%

will set the uid to write and own the files as.

Will that work for the distros? Søren, Andrea, Henne, ...?

[snip]

Quoted 9 lines

Thinks outloud..... what needs to be done as this user... hmmm

1. creating the spool area.
2. writing the alias file.
3. running the maintd from cron.

If we assume all operations are carried by root, then (1) can be done with a chown, (2) can be done with an su in the right place and (3) can be done with however one switches privs in c-code.

1. mlmmj-make-ml.sh -c will do that chown.
2. could also be a chown in mlmmj-make-ml.sh, I guess.
3. mlmmj-maintd does a setuid() to the owner of the list directory, if run as root.

Morten

Signature · 2 lines
Morten K. Poulsen <[email protected]>
http://www.afdelingp.dk/
#2 lore raw
In reply to Morten K. Poulsen
Quoted 4 lines · Morten K. Poulsen
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

2.
/bin/sh in Solaris is Posix shell and is much more strict than /bin/sh
on linux (which i think is just bash). mlmmj-make-ml.sh needs..

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Quoted 1 line
	#!/bin/bash

Which features of bash are needed in the script now? Would it be

possible to change it to not use those features?

it fails first with 'let', don't know after that. I switched to bash.

Ok, any shell scripting gurus on the list? :)

Well, I don't want to claim such a title...
But does

	/bin/sh -c "echo $((1+1))"

result in "2" for you, Rob?
If it does we could switch to using that syntax, since we're only using "let" in one place. It works with zsh, tcsh, ksh and bash on my box.

Regards,
Magnus

#3 lore raw
In reply to Morten K. Poulsen
Quoted 4 lines · Rob Shepherd
Quoted 4 lines

But does

	/bin/sh -c "echo $((1+1))"
Quoted 9 lines
Quoted 1 line

result in "2" for you, Rob?

Yes it does.

Send me an updated mlmmj-make-ml.sh with the updated scripting...

I'll test it.

Ok this is a patch against mlmmj-1.2.12-RC3, tell me if you need the patch against some other version. You apply it by issuing these commands:

	cd mlmmj-1.2.12-RC3
	patch -p1 < mlmmj-let-go-1.diff

And then try "make" again.
Also, could you please use "Reply To All" when youre answering mails to the mlmmj list? The list doesn't automatically gets a copy otherwise...

Regards,
Magnus

src/mlmmj-make-ml.sh.in +1 -1
@@ -46,7 +46,7 @@
 	exit 1
 esac
 done
-let SHIFTVAL=$OPTIND-1
+SHIFTVAL=$(( $OPTIND - 1 ))
 shift $SHIFTVAL
 
 if [ -z "$SPOOLDIR" ]; then