Run /usr/bin/wall as user 'upsd' possible?

I have tried to run a short script named test:

#!/bin/bash
MSG0=$'hey'
echo $MSG0 | /usr/bin/wall
wall $MSG0
echo 'abc'

as user upsd (who has no shell, i.e. /bin/false). I am doing it this way (as root):

# su - -s /bin/bash upsd -c "./test"
abc

which means the wall command doesn’t work, only echo. Permissions seem ok though:

-rwxr-xr-x 1 root tty 27480 Mar 13  2015 /usr/bin/wall*

How can I make this work?

It is SGID here which also explains why it does not work as normal user in your case. Did you set secure or paranoid file permissions in YaST?

It does work as normal user but not as user upsd.

Did you set secure or paranoid file permissions in YaST?

It is set to secure.

What should I do without reducing security or creating some inappropriate configuration? Add user upsd to group tty?

I would never use ./test in a case where I am not 1000% sure that I know what the current working directory is. And even then I would specify an absolute path (without any ~ or $HOME).

Do you mean it displays messages on terminals where you are logged in or where other users are logged in.

What should I do without reducing security or creating some inappropriate configuration?

You can add exceptions in /etc/security.d. Add exception for wall.

Add user upsd to group tty?

No, this won’t work. Process must belong to tty group; supplemental groups are not checked here.

The absolute path and the pwd where I test is /etc/ups/

If I run wall as normal user it sends both to myself and to root (logged in a separate kconsole) and I also receive a system tray notification in KDE.

You can add exceptions in /etc/security.d. Add exception for wall.

It seems I am missing this file?

ls: cannot access /etc/security.d: No such file or directory

# locate security.d
/etc/java/security/security.d
/usr/share/applications/YaST2/security.desktop
/usr/share/applications/YaST2/groups/security.desktop
/usr/share/desktop-directories/suse-system-security.directory
/usr/share/desktop-directories/suse-yast-security.directory
/usr/share/kde4/services/kmail_config_security.desktop