Install a new application and run in background

All about WTware on Raspberry. WTware works with Raspberry Pi 4, Raspberry Pi 3B+, Pi 3 and Pi 2 devices
http://www.winterminal.com
Post Reply
werneck.costa
Posts: 9
Joined: Mon Oct 14, 2019 4:09 pm

Install a new application and run in background

Post by werneck.costa »

I'm discovering WTWare and it solve some costumers issue. One of my services is to let the costumers to access their applications remotly, by RDP. It's working fine with WTWare.

Now, i'm wondering some questions, that is crucial to our business:
1 - is it possible to install/run some monitoring application (like Zabbix agent)?
2 - is it possible to install/run some configuration manager (like Ansible/puppet)?

Regards,
akatik
SUPPORT
SUPPORT
Posts: 631
Joined: Mon Jan 17, 2005 6:30 pm
Contact:

Re: Install a new application and run in background

Post by akatik »

There is "extra=" parameter to run external applications. But there are very few libraries in WTware, trivial shell and so on, because WTware is small. So something trivial, compiled statically, may run, but not huge monsters. So, answer is no for both questions.
werneck.costa
Posts: 9
Joined: Mon Oct 14, 2019 4:09 pm

Re: Install a new application and run in background

Post by werneck.costa »

Ok, thanks. Then one chance at least! :D
Is there some documentation about "extra=" parameter?
akatik
SUPPORT
SUPPORT
Posts: 631
Joined: Mon Jan 17, 2005 6:30 pm
Contact:

Re: Install a new application and run in background

Post by akatik »

Here is an example: viewtopic.php?t=48783
werneck.costa
Posts: 9
Joined: Mon Oct 14, 2019 4:09 pm

Re: Install a new application and run in background

Post by werneck.costa »

I guess i'm getting close:

| Archive: /tmp/extra-zabbix-agent.zip
| inflating: runme
| inflating: zabbix_agentd
| inflating: zabbix_agentd.conf
[ gm] [ 13.290685] +------------------------
[ gm] [ 13.291332] Run '/bin/sh /runme2unix', log '/tmp/extra.out', env '', pid ''.
[ pfac] [ 13.291472] Run /bin/sh /runme2unix.
[ pfac] [ 13.291748] Ok, PID 754.
[ EXTRA] [ 13.302096] /zabbix_agentd: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory
[EXTRA] close kotopipe (n = 0, errno 0).

Until weekend, it will work propertly.
werneck.costa
Posts: 9
Joined: Mon Oct 14, 2019 4:09 pm

Re: Install a new application and run in background

Post by werneck.costa »

Solved with this steps:
  • Raspbian installed on SDCard;
  • Zabbix agent compiled directly on Raspbian;
  • Brought "zabbix_agentd" binary from compilation (in my case: /usr/src/zabbix/zabbix-3.4.15/src/zabbix_agentd);
  • Reinstalled WTWare on SD card;
  • Prepared zabbix_agent.zip following @akatik indication, like this:

Code: Select all

#!/bin/sh
chmod +x zabbix_agentd
/zabbix_agentd -f -c zabbix_agentd.conf
  • Aditional configuration on "zabbix_agentd.conf":

Code: Select all

AllowRoot=1
  • Log results:

Code: Select all

| Archive:  /tmp/extra-zabbix-agent.zip
|   inflating: runme
|   inflating: zabbix_agentd
|   inflating: zabbix_agentd.conf
[            gm] [   15.368923] +------------------------
[            gm] [   15.370280] Run '/bin/sh /runme2unix', log '/tmp/extra.out', env '', pid ''.
[          pfac] [   15.370382] Run /bin/sh /runme2unix.
[          pfac] [   15.370712] Ok, PID 768.
[         EXTRA] [   15.381822] Starting Zabbix Agent [wtwXX27EBZZ5BAA]. Zabbix 3.4.15 (revision 86739).
[         EXTRA] [   15.381859] Press Ctrl+C to exit.
aka
SUPPORT
SUPPORT
Posts: 940
Joined: Fri Dec 03, 2004 2:05 pm
Contact:

Re: Install a new application and run in background

Post by aka »

Does it work? Remove '-f' from command line, it's not foreground.
werneck.costa
Posts: 9
Joined: Mon Oct 14, 2019 4:09 pm

Re: Install a new application and run in background

Post by werneck.costa »

Yes, it works!
"-f" is for run it in foreground. I believe it's necessary to WTWare get the logs. Is it?
aka
SUPPORT
SUPPORT
Posts: 940
Joined: Fri Dec 03, 2004 2:05 pm
Contact:

Re: Install a new application and run in background

Post by aka »

There is local syslog in wtware. Daemon may write logs to syslog if possible. I'm afraid foreground process may read from input, but there is no input.
werneck.costa
Posts: 9
Joined: Mon Oct 14, 2019 4:09 pm

Re: Install a new application and run in background

Post by werneck.costa »

Ok. What is the syslog file path?
My decision to foreground send was based on "docker way" to show logs. But, in this case, i can send to syslog.
akatik
SUPPORT
SUPPORT
Posts: 631
Joined: Mon Jan 17, 2005 6:30 pm
Contact:

Re: Install a new application and run in background

Post by akatik »

In zabbix_agentd.conf:

Code: Select all

LogType=system
How did you compile it? zabbix_agentd binary from Raspbian requires about twenty libraries that are not in wtware on time where extra= package run.
werneck.costa
Posts: 9
Joined: Mon Oct 14, 2019 4:09 pm

Re: Install a new application and run in background

Post by werneck.costa »

Ok about config file.
For the firts test, it was compiled from the most simple way:

Code: Select all

./configure --enable-agent
make
The second one, if necessary:

Code: Select all

./configure --enable-agent --without-ssl
The second form obligates the compilation processs to don't put any kind of SSL libs on the way. But the default already is "--without-ssl".
werneck.costa
Posts: 9
Joined: Mon Oct 14, 2019 4:09 pm

Re: Install a new application and run in background

Post by werneck.costa »

It:

Code: Select all

LogType=system
works fine:

Code: Select all

[SYSLOG] <30>Oct 18 14:58:29 zabbix_agentd[730]: Starting Zabbix Agent [wtw84273B3BAE6D]. Zabbix 3.4.15 (revision 86739).
[SYSLOG] <30>Oct 18 14:58:29 zabbix_agentd[730]: **** Enabled features ****
[SYSLOG] <30>Oct 18 14:58:29 zabbix_agentd[730]: IPv6 support:           NO
[SYSLOG] <30>Oct 18 14:58:29 zabbix_agentd[730]: TLS support:            NO
[SYSLOG] <30>Oct 18 14:58:29 zabbix_agentd[730]: **************************
[SYSLOG] <30>Oct 18 14:58:29 zabbix_agentd[730]: using configuration file: zabbix_agentd.conf
[SYSLOG] <30>Oct 18 14:58:29 zabbix_agentd[730]: agent #0 started [main process]
[SYSLOG] <30>Oct 18 14:58:29 zabbix_agentd[731]: agent #1 started [collector]
[SYSLOG] <30>Oct 18 14:58:29 zabbix_agentd[732]: agent #2 started [listener #1]
[SYSLOG] <30>Oct 18 14:58:29 zabbix_agentd[733]: agent #3 started [active checks #1]
[SYSLOG] <30>Oct 18 14:58:29 zabbix_agentd[734]: agent #4 started [active checks #2]
[SYSLOG] <28>Oct 18 14:58:29 zabbix_agentd[734]: no active checks on server [10.18.0.240:10051]: host [wtw84273B3BAE6D] not found
Thanks Aka!
werneck.costa
Posts: 9
Joined: Mon Oct 14, 2019 4:09 pm

Re: Install a new application and run in background

Post by werneck.costa »

In this link, you can get all files (including the zabbix_agent compiled for Raspberry):
http://bit.ly/wtware-zabbix-raspberry
Post Reply