# Cmd not working in ASL3?

**URL:** <https://community.allstarlink.org/t/cmd-not-working-in-asl3/22681>\
**Category:** AllStarLink\
**Created:** [January 12, 2025, 6:11pm UTC](https://community.allstarlink.org/t/cmd-not-working-in-asl3/22681 "2025-01-12T18:11:18Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![AH6LE](https://community.allstarlink.org/user_avatar/community.allstarlink.org/ah6le/32/1817_2.png) [@AH6LE](https://community.allstarlink.org/u/AH6LE)\
**Post date:** [January 12, 2025, 6:11pm UTC](https://community.allstarlink.org/t/cmd-not-working-in-asl3/22681/1 "2025-01-12T18:11:18Z")

</div>

Before ASL3, I had the following entry in my rpt.conf

```auto
883 = cmd,/usr/bin/ssh root@10.147.156.98 "/usr/sbin/asterisk -rx 'rpt fun 1100 *8131002'"

```

My controller would send DTMF to ASL (on local node 1102) and the remote node 1100 would execute properly. This no longer works with ASL3

I’ve verified the ssh command itself works properly from bash from Node 1102

```auto
/usr/bin/ssh root@10.147.156.98 "/usr/sbin/asterisk -rx 'rpt fun 1100 *8131002'"

```

and that the DTMF I’m sending to ASL3 on Node 1102 is properly being decoded.

I’ve also verified that:

```auto
rpt fun 1102 *883

```

does NOT work from the asterisk CLI on Node 1102.

Node 1100 is the remote node and 1102 is the local node I’m sending DTMF to.

Obviously I’m missing a change made (the line exists under node-main stanza in rpt.conf). I am running the latest ASL3 (updated last week)

---

<div class="post-metadata">

**Author:** ![WA3WCO](https://community.allstarlink.org/user_avatar/community.allstarlink.org/wa3wco/32/3123_2.png) [@WA3WCO](https://community.allstarlink.org/u/WA3WCO)\
**Post date:** [January 13, 2025, 12:47am UTC](https://community.allstarlink.org/t/cmd-not-working-in-asl3/22681/4 "2025-01-13T00:47:04Z")

</div>

Remember, in ASL3 the `asterisk` process runs as the “asterisk” user (not “root”).

Have you verified that the “asterisk” user can ssh to the “root” user on the remote host?

---

<div class="post-metadata">

**Author:** ![AH6LE](https://community.allstarlink.org/user_avatar/community.allstarlink.org/ah6le/32/1817_2.png) [@AH6LE](https://community.allstarlink.org/u/AH6LE)\
**Post date:** [January 13, 2025, 1:53am UTC](https://community.allstarlink.org/t/cmd-not-working-in-asl3/22681/5 "2025-01-13T01:53:01Z")

</div>

I just double checked and the ssh binary is executable by the world on the local node and the command

`"ssh root@xxx.xxx.xxx.xxx"`

logs into the remote host as root

---

<div class="post-metadata">

**Author:** ![AH6LE](https://community.allstarlink.org/user_avatar/community.allstarlink.org/ah6le/32/1817_2.png) [@AH6LE](https://community.allstarlink.org/u/AH6LE)\
**Post date:** [January 13, 2025, 9:56pm UTC](https://community.allstarlink.org/t/cmd-not-working-in-asl3/22681/7 "2025-01-13T21:56:11Z")

</div>

Arrrggh…

Contrary to the solution in this thread [https://community.allstarlink.org/t/cmd-in-rpt-conf-to-run-a-script/22105](https://community.allstarlink.org/t/cmd-in-rpt-conf-to-run-a-script/22105)

My ASL3 install does NOT run a script when called from rpt.conf.

Yes, the script has proper permissions set. Yes, the script runs fine when called from the shell. Yes, ASL3 is decoding the proper DTMF codes. No, ASL3 is not running the script when called.

I may just fall back to ASL2. This is a game killer for my linked system

---

<div class="post-metadata">

**Author:** ![N5LSN](https://community.allstarlink.org/user_avatar/community.allstarlink.org/n5lsn/32/2454_2.png) [@N5LSN](https://community.allstarlink.org/u/N5LSN)\
**Post date:** [January 13, 2025, 10:59pm UTC](https://community.allstarlink.org/t/cmd-not-working-in-asl3/22681/8 "2025-01-13T22:59:13Z")

</div>

My ASL3 runs scripts and commands just fine from in rpt.conf. Sounds like you don’t have something set up properly or are otherwise misunderstanding.

You keep saying that it will not run a script. How do you know this? Have you tried running a more basic script or command like a simple echo statement or file touch? You still have not stated whether or not you have tried manually running the script or command as the asterisk user.

Every thread that I have read so far with people complaining about how ASL3 doesn’t run their script or commands has boiled down to a simple misconfiguration or a lack of understanding of Linux permissions.

---

<div class="post-metadata">

**Author:** ![WA3WCO](https://community.allstarlink.org/user_avatar/community.allstarlink.org/wa3wco/32/3123_2.png) [@WA3WCO](https://community.allstarlink.org/u/WA3WCO)\
**Post date:** [January 13, 2025, 11:12pm UTC](https://community.allstarlink.org/t/cmd-not-working-in-asl3/22681/9 "2025-01-13T23:12:23Z")

</div>

Here’s what I have just tested :

1. In `/etc/asterisk/rpt.conf` I have added the following lines to the end of the `[functions]` stanza :

```auto
881 = cmd,touch /tmp/touch-was-executed
882 = cmd,/etc/asterisk/local/test.sh 1 2 3

```

1. I created the file `/etc/asterisk/local/test.sh` with the following lines :

```auto
#!/bin/bash
date >> /tmp/test.log
id >> /tmp/test.log
echo "args = $*" >> /tmp/test.log

```

1. I set the filesystem permissions on the above script :

```auto
sudo chmod 755 /etc/asterisk/local/test.sh

```

1. I restarted the asterisk process with :

```auto
sudo astres.sh

```

1. I made sure that the test result files were removed from the filesystem :

```auto
sudo rm -f /tmp/touch-was-executed
sudo rm -f /tmp/test.log

```

1. I tested both of these functions :

```auto
sudo asterisk -x 'rpt fun <my-node> *881'
sudo asterisk -x 'rpt fun <my-node> *882'

```

The 1st command should create (“touch”) the `/tmp/touch-was-executed` file and you should note that the file owner is “asterisk”. If you exec the command again the date stamp on the file should be updated.

The 2nd command should create the `/tmp/test.log` file with the content showing the date the command was exec’d, the “id” of the exec’ing user (e.g. “asterisk”), and the arguments from the `rpt.conf` file. If you exec the command again you should see additional lines appended to the end.

---

<div class="post-metadata">

**Author:** ![AH6LE](https://community.allstarlink.org/user_avatar/community.allstarlink.org/ah6le/32/1817_2.png) [@AH6LE](https://community.allstarlink.org/u/AH6LE)\
**Post date:** [January 14, 2025, 12:17am UTC](https://community.allstarlink.org/t/cmd-not-working-in-asl3/22681/10 "2025-01-14T00:17:45Z")

</div>

> [@WA3WCO](#):
>
> `sudo asterisk -x 'rpt fun <my-node> *881'`

As I posted, both the ssh binary and my script are both world executable (755). The asterisk process is reported running as user asterisk

```auto
root@ParrettASL:~# ps aux |grep asterisk
asterisk 31662 2.9 2.8 2175824 57484 ? Ssl 16:10 0:08 /usr/sbin/asterisk -g -f -p -U asterisk
asterisk 31663 0.0 0.0 2328 852 ? S 16:10 0:00 astcanary /var/run/asterisk/alt.asterisk.canary.tweet.tweet.tweet 31662
root 31772 0.0 0.1 6332 2104 pts/0 S+ 16:15 0:00 grep asterisk

```

The script I am calling runs fine from the shell as user asterisk.

I will try your exact scripts/rpt.conf edits and report back

---

<div class="post-metadata">

**Author:** ![AH6LE](https://community.allstarlink.org/user_avatar/community.allstarlink.org/ah6le/32/1817_2.png) [@AH6LE](https://community.allstarlink.org/u/AH6LE)\
**Post date:** [January 14, 2025, 1:02am UTC](https://community.allstarlink.org/t/cmd-not-working-in-asl3/22681/11 "2025-01-14T01:02:00Z")

</div>

OK, made the edits and copied EXACTLY what you did and nothing. No touched file, no test.log created

---

<div class="post-metadata">

**Author:** ![AH6LE](https://community.allstarlink.org/user_avatar/community.allstarlink.org/ah6le/32/1817_2.png) [@AH6LE](https://community.allstarlink.org/u/AH6LE)\
**Post date:** [January 14, 2025, 1:44am UTC](https://community.allstarlink.org/t/cmd-not-working-in-asl3/22681/12 "2025-01-14T01:44:12Z")

</div>

Mason, see my post right above yours. I did indeed say it would run properly from the shell.

I also stated permissions of the script are correct (world executable, i.e. 755).

Anyway, Allan was kind enough to email me directly and offered his help. I’ll report the final outcome with this

---

<div class="post-metadata">

**Author:** ![N5LSN](https://community.allstarlink.org/user_avatar/community.allstarlink.org/n5lsn/32/2454_2.png) [@N5LSN](https://community.allstarlink.org/u/N5LSN)\
**Post date:** [January 14, 2025, 1:58am UTC](https://community.allstarlink.org/t/cmd-not-working-in-asl3/22681/13 "2025-01-14T01:58:15Z")

</div>

> [@AH6LE](#):
>
> I did indeed say it would run properly from the shell.

That is not what was asked.

> [@AH6LE](#):
>
> Yes, the script runs fine when called from the shell.

…does not answer the question:

> [@N5LSN](#):
>
> whether or not you have tried manually running the script or command as the asterisk user

Are you logged in as root and “testing” the script by running it directly as the root user? You never specified. How should we know?

Anyways, hope you get it figured out.

People are **so** quick to hop on here and holler “This thing I’m trying to do doesn’t work! ASL3 sucks! I’m going back to ASL2/hamvoip/whatever!” It gets kinda old.

---

<div class="post-metadata">

**Author:** ![WA3WCO](https://community.allstarlink.org/user_avatar/community.allstarlink.org/wa3wco/32/3123_2.png) [@WA3WCO](https://community.allstarlink.org/u/WA3WCO)\
**Post date:** [January 14, 2025, 2:12am UTC](https://community.allstarlink.org/t/cmd-not-working-in-asl3/22681/14 "2025-01-14T02:12:01Z")

</div>

One additional tidbit that may help folks testing out any scripts they write that will be exec’d as the “asterisk” user would be to try exec’ing their scripts with `sudo -u asterisk ...`.

For the test script I noted above you would exec :

```auto
sudo -u asterisk /etc/asterisk/local/test.sh a b c

```

To see if `ssh` would work the following command might be informative :

```auto
sudo -u asterisk ssh root@xxx.xxx.xxx.xxx /bin/date

```

---

<div class="post-metadata">

**Author:** ![AH6LE](https://community.allstarlink.org/user_avatar/community.allstarlink.org/ah6le/32/1817_2.png) [@AH6LE](https://community.allstarlink.org/u/AH6LE)\
**Post date:** [January 14, 2025, 11:15pm UTC](https://community.allstarlink.org/t/cmd-not-working-in-asl3/22681/15 "2025-01-14T23:15:00Z")

</div>

We can close this thread. The issue was on the remote node 1100 in that I had not set up passwordless login to it as user asterisk (I only had done that as root). So the remote node was asking for the password but it was never sent, so the command sent failed.

The script on 1102 was running as it should. Thanks to all who offered assistance, especially Allan.

---

<div class="post-metadata">

**Author:** ![system](https://community.allstarlink.org/uploads/default/original/2X/4/42700284e201b031bd667c3f63bbae05a74b3104.png) [@system](https://community.allstarlink.org/u/system)\
**Post date:** [January 17, 2025, 11:15pm UTC](https://community.allstarlink.org/t/cmd-not-working-in-asl3/22681/16 "2025-01-17T23:15:59Z")

</div>

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
