# Crowdsec packages for OpenWrt

**URL:** <https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648>\
**Category:** For Developers\
**Created:** [July 31, 2021, 5:02am UTC](https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648 "2021-07-31T05:02:13Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![erdoukki](https://forum.openwrt.org/user_avatar/forum.openwrt.org/erdoukki/32/52960_2.png) [@erdoukki](https://forum.openwrt.org/u/erdoukki)\
**Post date:** [July 31, 2021, 5:02am UTC](https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648/1 "2021-07-31T05:02:13Z")

</div>

Héllo all,

Here is a PR for CrowdSec v1.1.1 and CrowdSec-FireWall-Bouncer v0.0.13

> <https://github.com/openwrt/packages/pull/16244>
>
> /net/crowdsec/
> 
> Crowdsec - An open-source, lightweight agent to detect
> and r…espond to bad behaviours.
> It also automatically benefits from a global community-wide
> IP reputation database.
> 
> Signed-off-by: Kerma Gérald \<gandalf@gk2.net\>
> 
> \> CrowdSec - the open-source and participative IPS able to analyze visitor behavior & provide an adapted response to all kinds of attacks. It also leverages the crowd power to generate a global CTI database to protect the user network. 
> 
> Maintainer: Gérald Kerma \<Gandalf@Gk2.net\> 
> 
> Compile tested: 
> \- ARM64, MVEBU, EspressoBin & EspressoBin Ultra, OpenWrt master)
> \- MIPS, MT7621, Xiaomi Mi Router 3 Pro, OpenWrt master)
> 
> Run tested: 
> \- ARM64, MVEBU, EspressoBin & EspressoBin Ultra, OpenWrt version 19.07.7 & 21.02-RC4)
> 
> Short Descritpion: 
> CrowdSec is an Open Source Participative Security IPS.
> 
> Description:
> Crowdsec - An open-source, lightweight agent to detect and respond to bad behaviours. It also automatically benefits from our global community-wide IP reputation database.
> crowdsec-firewall-bouncer will fetch new and old decisions from a CrowdSec API to add them in a blocklist used by supported firewalls.
> 
> References:
> https://github.com/crowdsecurity/crowdsec/issues/685
> 
> CrowdSec is the new Fail2Ban alternative...
> CrowdSec is an open-source and collaborative EDR.
> Analyze behaviors, respond to attacks & share signals across the community.
> 
> \> CrowdSec is a free, modern & collaborative behavior detection engine, coupled with a global IP reputation network. It stacks on fail2ban's philosophy but is IPV6 compatible and 60x faster (Go vs Python), uses Grok patterns to parse logs and YAML scenario to identify behaviors. CrowdSec is engineered for modern Cloud / Containers / VM based infrastructures (by decoupling detection and remediation). Once detected you can remedy threats with various bouncers (firewall block, nginx http 403, Captchas, etc.) while the aggressive IP can be sent to CrowdSec for curation before being shared among all users to further improve everyone's security.
> 
> More @ https://crowdsec.net/
> 
> Use case (POC):
> On an OpenWrt based router, you can quickly and efficiently ban a collaborative list of bad guys IP source, you can also centralize remote servers access attempts and ban on bad access attempts scenarios directly on your OpenWrt Internet access gateway...
> 
> Forum Topic : 
> https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648/

I still get an issue with ARM compile and buildroot…  
See [https://github.com/openwrt/packages/issues/16193](https://github.com/openwrt/packages/issues/16193)

Is there anyone who can help to fix this, please ?

UPDATE: now fixed and working !  
UPDATE: Topic title changed from

> Crowdsec: initial packages v1.2.0 for OpenWrt

UPDATE:

This work is still an active development phase on OpenWrt...  
As the wiki specific information on OpenWrt Wiki dedicated page.  
CrowdSec is an attractive and innovative solution, so I understand you want to give a try, but you must look to the Official CrowdSec documentation if you need more than what is available to the OpenWrt packages where I try to made some end users and user friendly, but completely unsupported and personal but in progress additions !

So, Enjoy, use it at your own risks, or made it better by yourself.  
😇

REF:

> **[CrowdSec](https://openwrt.org/docs/guide-user/services/crowdsec)**
>
> CrowdSec This wiki page is currently a work in progress and information is currently in the process of being transferred from the community forum. Main Website: Documentation : Release info: OpenWrt Forum thread: CrowdSec Forum thread:

---

<div class="post-metadata">

**Author:** ![erdoukki](https://forum.openwrt.org/user_avatar/forum.openwrt.org/erdoukki/32/52960_2.png) [@erdoukki](https://forum.openwrt.org/u/erdoukki)\
**Post date:** [July 31, 2021, 2:01pm UTC](https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648/2 "2021-07-31T14:01:36Z")

</div>

How can I enable (force) a CONFIG value from a Package Makefile ?  
Is it only possible to ?  
I need the toolchain (binutils) to being built with EXTRA as :

```
CONFIG_EXTRA_BINUTILS_CONFIG_OPTIONS="--enable-gold --enable-plugins"

```

UPDATE : now unnecessary and fixed

---

<div class="post-metadata">

**Author:** ![erdoukki](https://forum.openwrt.org/user_avatar/forum.openwrt.org/erdoukki/32/52960_2.png) [@erdoukki](https://forum.openwrt.org/u/erdoukki)\
**Post date:** [July 31, 2021, 3:45pm UTC](https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648/3 "2021-07-31T15:45:08Z")

</div>

Edit : made a PR to enable gold linker in binutils toolchain -\> [https://github.com/openwrt/openwrt/pull/4412](https://github.com/openwrt/openwrt/pull/4412)

UPDATE : now unnecessary and fixed

---

<div class="post-metadata">

**Author:** ![erdoukki](https://forum.openwrt.org/user_avatar/forum.openwrt.org/erdoukki/32/52960_2.png) [@erdoukki](https://forum.openwrt.org/u/erdoukki)\
**Post date:** [August 2, 2021, 12:29pm UTC](https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648/4 "2021-08-02T12:29:42Z")

</div>

packages available now for testing also for mipsel\_24kc ( like Device: Xiaomi R3P (mt7621)... )  
-\> [https://github.com/erdoukki/crowdsec-openwrt/tree/master/package/custom](https://github.com/erdoukki/crowdsec-openwrt/tree/master/package/custom)

UPDATE : now more up to date...

---

<div class="post-metadata">

**Author:** ![erdoukki](https://forum.openwrt.org/user_avatar/forum.openwrt.org/erdoukki/32/52960_2.png) [@erdoukki](https://forum.openwrt.org/u/erdoukki)\
**Post date:** [October 2, 2021, 5:42am UTC](https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648/5 "2021-10-02T05:42:18Z")

</div>

> [@erdoukki](#):
>
> Here is a PR for CrowdSec v1.1.1 and CrowdSec-FireWall-Bouncer v0.0.13

Now CrowdSec v1.2.0 and CrowdSec-FireWall-Bouncer v0.0.15

You can find the packages for testing at the Artifacts section from the build check of the PR section [https://github.com/openwrt/packages/actions/runs/1265111620](https://github.com/openwrt/packages/actions/runs/1265111620)

 ![Screenshot 2021-10-02 at 07-34-24 Crowdsec Initial package v1 2 0 · openwrt packages b382f87](https://forum.openwrt.org/uploads/default/original/3X/0/8/08159060b21919bba3752fbbc8a6c1bb145f6efd.png)

HowTo (short / quick / dirty / temporary) :  
Download package for your architecture and install with :

```plaintext
opkg install crowdsec*.ipk

```

verify :

```plaintext
root@ULTRA-5G:~/custom/1.2.0# service crowdsec status
running
root@ULTRA-5G:~/custom/1.2.0# service crowdsec-firewall-bouncer status
running

```

check :

```plaintext
root@ULTRA-5G:~/custom/1.2.0# cscli metrics
INFO[20-09-2021 07:58:05 AM] Local Api Metrics:                           
+----------------------+--------+------+
| ROUTE | METHOD | HITS |
+----------------------+--------+------+
+----------------------+------+---+
| /v1/decisions/stream | GET | 1 |
+======================+======+===+
| /v1/watchers/login | POST | 1 |
+----------------------+------+---+
+----------------------+--------+------+
INFO[20-09-2021 07:58:05 AM] Local Api Bouncers Metrics:                  
+------------------------------+----------------------+--------+------+
| BOUNCER | ROUTE | METHOD | HITS |
+------------------------------+----------------------+--------+------+
| cs-firewall-bouncer-1AZW62x2 | /v1/decisions/stream | GET | 1 |
+------------------------------+----------------------+--------+------+

```

test :

```plaintext
root@LPM:~# cscli alerts list
+-----+------------------------------+-----------------------------------+---------+--------------------------------+-----------+--------------------------------+
| ID | VALUE | REASON | COUNTRY | AS | DECISIONS | CREATED AT |
+-----+------------------------------+-----------------------------------+---------+--------------------------------+-----------+--------------------------------+
| 871 | Ip:143.198.56.171 | crowdsecurity/http-probing | US | MCI Communications Services, | ban:1 | 2021-10-02 07:27:23.57835364 |
| | | | | Inc. d/b/a Verizon Business | | +0200 +0200 |
| 870 | crowdsec/community-blocklist | update : +494/-0 IPs | | | ban:494 | 2021-10-02 07:18:38 +0200 |
| | | | | | | +0200 |
| 869 | crowdsec/community-blocklist | update : +496/-0 IPs | | | ban:4 | 2021-10-02 05:18:38 +0200 |
| | | | | | | +0200 |
...

```

And feel free to report here about OpenWrt packages, or ask directly at CrowdSec community [https://discourse.crowdsec.net/](https://discourse.crowdsec.net/) for specific usage and recommendation !

---

<div class="post-metadata">

**Author:** ![erdoukki](https://forum.openwrt.org/user_avatar/forum.openwrt.org/erdoukki/32/52960_2.png) [@erdoukki](https://forum.openwrt.org/u/erdoukki)\
**Post date:** [October 12, 2021, 6:52am UTC](https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648/6 "2021-10-12T06:52:10Z")

</div>

crowdsec: initial package v1.2.0 -\> [https://github.com/openwrt/packages/pull/16244](https://github.com/openwrt/packages/pull/16244)  
crowdsec-firewall-bouncer: initial package v0.0.15 -\> [https://github.com/openwrt/packages/pull/16844](https://github.com/openwrt/packages/pull/16844)

Merged yesterday in master !

---

<div class="post-metadata">

**Author:** ![erdoukki](https://forum.openwrt.org/user_avatar/forum.openwrt.org/erdoukki/32/52960_2.png) [@erdoukki](https://forum.openwrt.org/u/erdoukki)\
**Post date:** [October 12, 2021, 7:31am UTC](https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648/7 "2021-10-12T07:31:08Z")

</div>

> <https://github.com/openwrt/packages/pull/16870>
>
> Maintainer: Kerma Gérald / @erdoukki / gandalf@gk2.net
> Compile tested: (aarch64…\_cortex-a53, espressobin board, OpenWrt master/19.07/21.02)
> Run tested: (aarch64\_cortex-a53, espressobin board, OpenWrt master/19.07/21.02)
> 
> Description:
> crowdsec: initial package v1.2.0 for 21.02 cherry-picked https://github.com/openwrt/packages/pull/16244 https://github.com/openwrt/packages/pull/16244/commits/8903d1b7ca403bcffaead372ac288213252d5d75
> crowdsec-firewall-bouncer: initial package v0.0.15 for 21.02 cherry-picked https://github.com/openwrt/packages/pull/16844 https://github.com/openwrt/packages/pull/16844/commits/676a621647000c2618360a7752151c7110bd6c58
> 
> @jefferyto @PolynomialDivision

---

<div class="post-metadata">

**Author:** ![erdoukki](https://forum.openwrt.org/user_avatar/forum.openwrt.org/erdoukki/32/52960_2.png) [@erdoukki](https://forum.openwrt.org/u/erdoukki)\
**Post date:** [October 12, 2021, 7:46am UTC](https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648/8 "2021-10-12T07:46:04Z")

</div>

> **[CrowdSec package for OpenWrt](https://discourse.crowdsec.net/t/crowdsec-package-for-openwrt/225)**
>
> Tested on mvebu espressobin board ultra and espressobin board v7 eMMC, in OpenWrt 21.02-RC3 et OpenWrt 19.07.7… … ENJOY ! Note : feedback welcome ! 😉

---

<div class="post-metadata">

**Author:** ![erdoukki](https://forum.openwrt.org/user_avatar/forum.openwrt.org/erdoukki/32/52960_2.png) [@erdoukki](https://forum.openwrt.org/u/erdoukki)\
**Post date:** [October 12, 2021, 12:19pm UTC](https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648/9 "2021-10-12T12:19:09Z")

</div>

> <https://github.com/openwrt/packages/pull/16875>
>
> Maintainer: Kerma Gérald / @erdoukki / gandalf@gk2.net
> Compile tested: (aarch64…\_cortex-a53, espressobin board, OpenWrt master/19.07/21.02)
> Run tested: (aarch64\_cortex-a53, espressobin board, OpenWrt master/19.07/21.02)
> 
> Description:
> crowdsec: initial package v1.2.0 for 21.02 cherry-picked https://github.com/openwrt/packages/pull/16244 https://github.com/openwrt/packages/pull/16244/commits/8903d1b7ca403bcffaead372ac288213252d5d75
> crowdsec-firewall-bouncer: initial package v0.0.15 for 21.02 cherry-picked https://github.com/openwrt/packages/pull/16844 https://github.com/openwrt/packages/pull/16844/commits/676a621647000c2618360a7752151c7110bd6c58
> 
> Replacement for
> https://github.com/openwrt/packages/pull/16870
> https://github.com/openwrt/packages/pull/16874
> 
> @jefferyto @PolynomialDivision

---

<div class="post-metadata">

**Author:** ![erdoukki](https://forum.openwrt.org/user_avatar/forum.openwrt.org/erdoukki/32/52960_2.png) [@erdoukki](https://forum.openwrt.org/u/erdoukki)\
**Post date:** [October 14, 2021, 6:28am UTC](https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648/10 "2021-10-14T06:28:26Z")

</div>

The PR was merged this morning and packages will be available in few days for 21.02 !

🥳

---

<div class="post-metadata">

**Author:** ![anon50098793](https://forum.openwrt.org/letter_avatar/anon50098793/32/6_449c533f586939b6e5f246632a46421f.png) [@anon50098793](https://forum.openwrt.org/u/anon50098793)\
**Post date:** [October 14, 2021, 8:21am UTC](https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648/11 "2021-10-14T08:21:06Z")

</div>

installing owns console is this expected behavior?

> **console-hangs**
>
> ```
> dca632 /usbstick 54°# opkg install crowdsec
> Installing crowdsec (1.2.0-1) to root...
> Downloading http://downloads.openwrt.org/snapshots/packages/aarch64_cortex-a72/packages/crowdsec_1.2.0-1_aarch64_cortex-a72.ipk
> Configuring crowdsec.
> WARN[14-10-2021 07:16:13 PM] can't load CAPI credentials from '/etc/crowdsec/online_api_credentials.yaml' (missing field) 
> INFO[14-10-2021 07:16:13 PM] push and pull to Central API disabled        
> INFO[14-10-2021 07:16:13 PM] Machine 'MACHINE' successfully added to the local API 
> INFO[14-10-2021 07:16:13 PM] API credentials dumped to '/etc/crowdsec/local_api_credentials.yaml' 
> WARN[14-10-2021 07:16:14 PM] can't load CAPI credentials from '/etc/crowdsec/online_api_credentials.yaml' (missing field) 
> INFO[14-10-2021 07:16:14 PM] push and pull to Central API disabled        
> INFO[14-10-2021 07:16:16 PM] Successfully registered to Central API (CAPI) 
> INFO[14-10-2021 07:16:16 PM] Central API credentials dumped to '/etc/crowdsec/online_api_credentials.yaml' 
> WARN[14-10-2021 07:16:16 PM] Run 'sudo systemctl reload crowdsec' for the new configuration to be effective. 
> INFO[14-10-2021 07:16:17 PM] Wrote new 147807 bytes index to /etc/crowdsec/hub/.index.json 
> INFO[14-10-2021 07:16:18 PM] crowdsecurity/syslog-logs : OK               
> INFO[14-10-2021 07:16:18 PM] /etc/crowdsec/parsers/s00-raw doesn't exist, create 
> INFO[14-10-2021 07:16:18 PM] Enabled parsers : crowdsecurity/syslog-logs  
> INFO[14-10-2021 07:16:18 PM] crowdsecurity/geoip-enrich : OK              
> INFO[14-10-2021 07:16:18 PM] downloading data 'https://crowdsec-statics-assets.s3-eu-west-1.amazonaws.com/GeoLite2-City.mmdb' in '/srv/crowdsec/data/GeoLite2-City.mmdb' 
> 
> ^CInterrupted. Writing out status database.
> 
> ```
> 
> seems to be from your uci-defaults/99\_crowdsec last line;
> 
> ```
> cscli hub update && cscli collections install crowdsecurity/linux && cscli parsers install crowdsecurity/whitelists && cscli hub upgrade
> 
> ```

edit: console finally exited after 2mins... how big is the download... (is interactive/uci-defaults the best way to handle this... firstboot internet connectivity might cause some issues here)

60M... slow servers maybe...

```
dca632 /usbstick 55°# du -chs /srv/crowdsec/data/*
5.7M	/srv/crowdsec/data/GeoLite2-ASN.mmdb
53.2M	/srv/crowdsec/data/GeoLite2-City.mmdb
136.0K	/srv/crowdsec/data/crowdsec.db
59.0M	total

```

---

<div class="post-metadata">

**Author:** ![erdoukki](https://forum.openwrt.org/user_avatar/forum.openwrt.org/erdoukki/32/52960_2.png) [@erdoukki](https://forum.openwrt.org/u/erdoukki)\
**Post date:** [October 14, 2021, 9:23am UTC](https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648/12 "2021-10-14T09:23:39Z")

</div>

Thanks for the feedback…

> [@anon50098793](#):
>
> installing owns console is this expected behavior?

Yes,  
It had some pre-install command integrated.  
I must write a full OpenWrt documentation, but you may look at the default crowdsec documentations since I wrote OpenWrt specific…

The /srv/crowdsec must exist in a persistent storage.

I look at this ASAP…

Some initial commands may have been moved while PR reviews !  
It need to be ready after installation, but I think there is no problem, since the Crowdsec package is not integrate in a firmware image for now.

---

<div class="post-metadata">

**Author:** ![anon50098793](https://forum.openwrt.org/letter_avatar/anon50098793/32/6_449c533f586939b6e5f246632a46421f.png) [@anon50098793](https://forum.openwrt.org/u/anon50098793)\
**Post date:** [October 15, 2021, 2:34am UTC](https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648/13 "2021-10-15T02:34:42Z")

</div>

```
################# grep INSTALL_DIR net/crowdsec/Makefile 
	$(INSTALL_DIR) $(1)/etc/crowdsec
	$(INSTALL_DIR) $(1)/etc/crowdsec/scenarios
	$(INSTALL_DIR) $(1)/etc/crowdsec/postoverflows
	$(INSTALL_DIR) $(1)/etc/crowdsec/collections
	$(INSTALL_DIR) $(1)/etc/crowdsec/patterns
	$(INSTALL_DIR) $(1)/etc/crowdsec/hub
	$(INSTALL_DIR) $(1)/srv/crowdsec/data/
	$(INSTALL_DIR) $(1)/etc/init.d
	$(INSTALL_DIR) $(1)/etc/config
	$(INSTALL_DIR) $(1)/etc/uci-defaults

```

```
dca632 /usbstick 53°# grep plugins /etc/crowdsec/config.yaml
  plugin_dir: /usr/local/lib/crowdsec/plugins/

dca632 /usbstick 54°# ls -lah /usr/local/lib/crowdsec/plugins/
ls: /usr/local/lib/crowdsec/plugins/: No such file or directory

```

afaik, we don't have /usr/local in OpenWrt

---

<div class="post-metadata">

**Author:** ![anon50098793](https://forum.openwrt.org/letter_avatar/anon50098793/32/6_449c533f586939b6e5f246632a46421f.png) [@anon50098793](https://forum.openwrt.org/u/anon50098793)\
**Post date:** [October 15, 2021, 6:04am UTC](https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648/14 "2021-10-15T06:04:48Z")

</div>

> [@erdoukki](#):
>
> I think there is no problem, since the Crowdsec package is not integrate in a firmware image for now

it may not be a default package... but it's not unreasonable to assume that people will attempt to include it by default when they create their own images...

the question(s) is(are);

- how does the daemon behave when/if these commands fail on firstboot?
- does the daemon / init script inform the user?
- does the daemon / init script re-attempt?

```plaintext
[41.389597] welcomeback localversion="3.5.75-7" > localversion="3.5.95-5"
[42.033515] 99_crowdsec-ucidefault start
[42.366744] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: 
[42.936193] 99_crowdsec-ucidefault finished
[45.786811] bcmgenet fd580000.ethernet: configuring instance for external RGMII (RX delay)
[45.795668] bcmgenet fd580000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[45.796957] br-lan: port 1(eth0) entered blocking state
[45.809008] br-lan: port 1(eth0) entered disabled state
[45.814410] device eth0 entered promiscuous mode
[45.820181] br-lan: port 1(eth0) entered blocking state
[45.825423] br-lan: port 1(eth0) entered forwarding state
[46.791390] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
[47.115424] netlink: 'iw': attribute type 302 has an invalid length.
...(eth1 is WAN)
[49.544213] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
[49.550994] r8152 2-2:1.0 eth1: carrier on

```

```plaintext
[root@dca632 /usbstick/_CROWDSEC 52°]# ps w | grep crowd | grep -v grep
[root@dca632 /usbstick/_CROWDSEC 53°]# logread | grep crowd
[root@dca632 /usbstick/_CROWDSEC 53°]# cat /var/log/crowdsec.log
time="15-10-2021 16:50:19" level=info msg="Crowdsec v1.2.0-openwrt-openwrt"
time="15-10-2021 16:50:19" level=info msg="Loading prometheus collectors"
time="15-10-2021 16:50:19" level=fatal msg="crowdsec init: Failed to load hub index : unable to read index file: open /etc/crowdsec/hub/.index.json: no such file or directory"

```

---

<div class="post-metadata">

**Author:** ![erdoukki](https://forum.openwrt.org/user_avatar/forum.openwrt.org/erdoukki/32/52960_2.png) [@erdoukki](https://forum.openwrt.org/u/erdoukki)\
**Post date:** [October 15, 2021, 6:23am UTC](https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648/15 "2021-10-15T06:23:47Z")

</div>

> [@anon50098793](#):
>
> `time="15-10-2021 16:50:19" level=fatal msg="crowdsec init: Failed to load hub index : unable to read index file: open /etc/crowdsec/hub/.index.json: no such file or directory"`

Have you let the full install process be done ?

If you have interrupt the install, the initial commands will not have processed correctly !

---

<div class="post-metadata">

**Author:** ![erdoukki](https://forum.openwrt.org/user_avatar/forum.openwrt.org/erdoukki/32/52960_2.png) [@erdoukki](https://forum.openwrt.org/u/erdoukki)\
**Post date:** [October 15, 2021, 6:25am UTC](https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648/16 "2021-10-15T06:25:47Z")

</div>

> [@anon50098793](#):
>
> it may not be a default package... but it's not unreasonable to assume that people will attempt to include it by default when they create their own images...

Yes, it is why I have said I will look at your first report...

I may propose a crowdsec-data package to integrate the first install data download.

Or move this download further...

Or simply remove the first initial installation I have integrate in the package to simplify the usage for the user, and let him do all by itself reading the documentations...

---

<div class="post-metadata">

**Author:** ![erdoukki](https://forum.openwrt.org/user_avatar/forum.openwrt.org/erdoukki/32/52960_2.png) [@erdoukki](https://forum.openwrt.org/u/erdoukki)\
**Post date:** [October 15, 2021, 6:28am UTC](https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648/17 "2021-10-15T06:28:09Z")

</div>

> [@anon50098793](#):
>
> - how does the daemon behave when/if these commands fail on firstboot?

It simply do not work since you remade the needed commands.  
But some checks like in upgrade may bot work.

> [@anon50098793](#):
>
> - does the daemon / init script inform the user?

The log may, but the Init script don't.

> [@anon50098793](#):
>
> - does the daemon / init script re-attempt?

No. not for now.

---

<div class="post-metadata">

**Author:** ![anon50098793](https://forum.openwrt.org/letter_avatar/anon50098793/32/6_449c533f586939b6e5f246632a46421f.png) [@anon50098793](https://forum.openwrt.org/u/anon50098793)\
**Post date:** [October 15, 2021, 6:30am UTC](https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648/18 "2021-10-15T06:30:03Z")

</div>

> [@erdoukki](#):
>
> since you remade the needed commands

negative (your commands were all present at firstboot but failed because they run before any network interfaces are available)

> [@erdoukki](#):
>
> It simply do not work

correct

---

<div class="post-metadata">

**Author:** ![erdoukki](https://forum.openwrt.org/user_avatar/forum.openwrt.org/erdoukki/32/52960_2.png) [@erdoukki](https://forum.openwrt.org/u/erdoukki)\
**Post date:** [October 15, 2021, 6:32am UTC](https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648/19 "2021-10-15T06:32:09Z")

</div>

> [@anon50098793](#):
>
> negative

?

> [@anon50098793](#):
>
> ```plaintext
> dca632 /usbstick 53°# grep plugins /etc/crowdsec/config.yaml
> plugin_dir: /usr/local/lib/crowdsec/plugins/
> 
> dca632 /usbstick 54°# ls -lah /usr/local/lib/crowdsec/plugins/
> ls: /usr/local/lib/crowdsec/plugins/: No such file or directory
> 
> ```
> 
> afaik, we don't have /usr/local in OpenWrt

Yes, and it is not used, or I have missing something...

I will patch to move this folder.

Update : To be fixed, it is a new feature from the v1.2.0 and I have missed this part !

---

<div class="post-metadata">

**Author:** ![erdoukki](https://forum.openwrt.org/user_avatar/forum.openwrt.org/erdoukki/32/52960_2.png) [@erdoukki](https://forum.openwrt.org/u/erdoukki)\
**Post date:** [October 15, 2021, 6:34am UTC](https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648/20 "2021-10-15T06:34:20Z")

</div>

> [@anon50098793](#):
>
> negative (your commands were all present at firstboot but failed because they run before any network interfaces are available)

I do not understand how you have installed the package ?  
If you let it fully install and then reboot, is it okay ?

Because you have interrupt the install, the commands did not complete...

What the firstboot do here ?  
The script is also apply at installation, and then uneeded at firstboot.  
It will only be used at firstboot if you integrate the package in a custom firmware, what is it not supported for now, as I have already said.

[Next page](https://forum.openwrt.org/t/crowdsec-packages-for-openwrt/102648.md?page=2)
