ccache failed to create temp files in /var/cache/ccache/ , permission denied. On Gentoo Linux - linux

System Info:
OS : Gentoo Linux x86_64
Kernel : Linux 5.4.38
CPU : Intel core i7-7820HQ
RAM : 16GiB
CC : GCC 9.3.0
This problem always happens when I install the emerge software.
My ccache directory is mounted on /dev/sda2, which is a primary partition in btrfs.
The corresponding directory permissions have been set.
/etc/fstab I posted below.
This is one of error messages:
==> COMPILING "OBJ/amd64-linux-cc/pic/fcons.o"
+ x86_64-pc-linux-gnu-gcc -fpic -march=native -O2 -pipe -finput-charset=ISO-8859-1 -fexec-charset=UTF-8 -DSCHILY_BUILD -IOBJ/amd64-linux-cc/pic -I../incs/amd64-linux-cc -I../include -Istdio -DUSE_SCANSTACK -DPORT_ONLY -D_GNU_SOURCE -c -o OBJ/amd64-linux-cc/pic/fcons.o stdio/fcons.c
ccache: error: Failed to create temporary file for /var/cache/ccache/7/d/f/cc59f6a892af180b36bf0d7b73f8c-148524.o.tmp.stdout: Permission denied
make[2]: *** [../RULES/r-gmake.obj:51: OBJ/amd64-linux-cc/pic/fcons.o] Error 1
make[2]: Leaving directory '/var/tmp/portage/app-cdr/cdrtools-3.02_alpha09-r2/work/cdrtools-3.02/libschily'
make[1]: *** [../RULES/rules.mks:23: all] Error 2
make[1]: Leaving directory '/var/tmp/portage/app-cdr/cdrtools-3.02_alpha09-r2/work/cdrtools-3.02/libschily'
make: *** [RULES/rules1.dir:25: all] Error 2
* ERROR: app-cdr/cdrtools-3.02_alpha09-r2::gentoo failed (compile phase):
* emake failed
*
* If you need support, post the output of `emerge --info '=app-cdr/cdrtools-3.02_alpha09-r2::gentoo'`,
* the complete build log and the output of `emerge -pqv '=app-cdr/cdrtools-3.02_alpha09-r2::gentoo'`.
* The complete build log is located at '/var/tmp/portage/app-cdr/cdrtools-3.02_alpha09-r2/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/app-cdr/cdrtools-3.02_alpha09-r2/temp/environment'.
* Working directory: '/var/tmp/portage/app-cdr/cdrtools-3.02_alpha09-r2/work/cdrtools-3.02'
* S: '/var/tmp/portage/app-cdr/cdrtools-3.02_alpha09-r2/work/cdrtools-3.02'
Failed to emerge app-cdr/cdrtools-3.02_alpha09-r2, Log file:
'/var/tmp/portage/app-cdr/cdrtools-3.02_alpha09-r2/temp/build.log'
ccache config & status:
(default) base_dir =
(environment) cache_dir = /var/cache/ccache
(/var/cache/ccache/ccache.conf) cache_dir_levels = 3
(/var/cache/ccache/ccache.conf) compiler = gcc
(/var/cache/ccache/ccache.conf) compiler_check = %compiler% -v
(/var/cache/ccache/ccache.conf) compression = true
(/var/cache/ccache/ccache.conf) compression_level = 1
(default) cpp_extension =
(default) debug = false
(default) depend_mode = false
(default) direct_mode = true
(default) disable = false
(default) extra_files_to_hash =
(default) hard_link = false
(default) hash_dir = true
(default) ignore_headers_in_manifest =
(default) keep_comments_cpp = false
(default) limit_multiple = 0.8
(default) log_file =
(default) max_files = 0
(/var/cache/ccache/ccache.conf) max_size = 100.0G
(/var/cache/ccache/ccache.conf) path = /usr/bin:/usr/local/bin
(default) pch_external_checksum = false
(default) prefix_command =
(default) prefix_command_cpp =
(default) read_only = false
(default) read_only_direct = false
(default) recache = false
(default) run_second_cpp = true
(default) sloppiness =
(default) stats = true
(default) temporary_dir =
(default) umask =
cache directory /var/cache/ccache
primary config /var/cache/ccache/ccache.conf
secondary config (readonly) /etc/ccache.conf
stats updated Sat May 23 16:40:07 2020
cache hit (direct) 4029
cache hit (preprocessed) 860
cache miss 19704
cache hit rate 19.88 %
called for link 3119
called for preprocessing 2708
multiple source files 2
compiler produced stdout 4
compiler produced empty output 30
compile failed 1624
preprocessor error 247
couldn't find the compiler 2
bad compiler arguments 464
autoconf compile/link 5507
unsupported compiler option 835
unsupported code directive 4
could not write to output file 90
no input file 1576
cleanups performed 0
files in cache 52712
cache size 1.2 GB
max cache size 100.0 GB
some info of /var/cache/ccache:
drwxrwsr-x 1 root portage 66 May 23 16:40 0
drwxrwsr-x 1 root portage 66 May 23 16:38 1
drwxrwsr-x 1 root portage 66 May 23 16:39 2
drwxrwsr-x 1 root portage 66 May 23 16:38 3
drwxrwsr-x 1 root portage 66 May 23 16:38 4
drwxrwsr-x 1 root portage 66 May 23 16:38 5
drwxrwsr-x 1 root portage 66 May 23 16:38 6
drwxrwsr-x 1 root portage 66 May 23 16:38 7
drwxrwsr-x 1 root portage 66 May 23 16:38 8
drwxrwsr-x 1 root portage 66 May 23 16:38 9
drwxrwsr-x 1 root portage 66 May 23 16:38 a
drwxrwsr-x 1 root portage 66 May 23 16:38 b
drwxrwsr-x 1 root portage 66 May 23 16:38 c
-rwxrwxr-x 1 root portage 209 May 23 11:17 ccache.conf
drwxrwsr-x 1 root portage 66 May 23 16:38 d
drwxrwsr-x 1 root portage 66 May 23 16:40 e
drwxrwsr-x 1 root portage 66 May 23 16:38 f
drwxrwsr-x 1 portage portage 0 May 23 16:38 tmp
fstab :
UUID=EA7D-E1DB /boot vfat defaults,noatime,discard 0 2
UUID=4f174448-dcef-4e12-ae0a-f5c79cfe3da6 none swap sw,discard 0 0
UUID=1bb4ace3-1fba-4068-bea7-e7d307d56fa3 / btrfs noatime,discard 0 1
UUID=81210f26-8349-4aed-9ad4-55626fc10be9 /home btrfs noatime,discard 0 1
UUID=c8f65f22-8271-4457-a891-4e877fb2b98c /var/cache/ccache btrfs noatime,discard 0 1
make.conf :
COMMON_FLAGS="-march=native -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
PORTDIR="/var/db/repos/gentoo"
DISTDIR="/var/cache/distfiles"
PKGDIR="/var/cache/binpkgs"
LC_MESSAGES=C
MAKEOPTS="-j2 -l2"
GENTOO_MIRRORS="https://mirrors.tuna.tsinghua.edu.cn/gentoo"
INPUT_DEVICES="libinput evdev vmmouse touchpad joystick synaptics"
VIDEO_CARDS="nvidia"
USE_PYTHON="3.7"
PYTHON_TARGETS="python3_7"
USE="static-libs systemd dbus policykit udisks acpi bluetooth X alsa qt5 gtk kde wayland pulseaudio mysql networkmanager thunderbolt zsh-completion apparmor -ssh"
CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3"
PORTAGE_ELOG_CLASSES="log"
PORTAGE_ELOG_SYSTEM="save"
FEATURES="ccache nostrip"
CCACHE_DIR="/var/cache/ccache"

Related

How to use a Linux "platform_driver"?

There is an embedded system, and it provides functions in a struct of platform_driver:
static struct platform_driver infinity_wdt_driver = {
.probe = infinity_wdt_probe,
.remove = infinity_wdt_remove,
.shutdown = infinity_wdt_shutdown,
.driver = {
.owner = THIS_MODULE,
.name = "infinity-wdt",
.of_match_table = ms_watchdog_of_match_table,
},
};
module_platform_driver(infinity_wdt_driver);
In the infinity_wdt_probe it calls devm_kzalloc and devm_ioremap_resource:
static int infinity_wdt_probe(struct platform_device *pdev) {
...
wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL);
...
wdt->reg_base = devm_ioremap_resource(&pdev->dev, res);
...
}
How shall I utilize this driver? Do I need to write some C code, or Linux provides some standard way through filesystem for controlling this?
In the filesystem there is a directory under /sys/bus/platform/drivers/infinity-wdt, but it contains only a few files:
# ls -l
total 0
lrwxrwxrwx 1 root root 0 Nov 16 20:23 1f006000.watchdog -> ../../../../devices/soc0/soc/1f006000.watchdog
--w------- 1 root root 4096 Nov 16 20:23 bind
--w------- 1 root root 4096 Nov 16 20:23 uevent
--w------- 1 root root 4096 Nov 16 20:23 unbind
Is it somehow possible to use the driver with this filesystem above?
Some extra info: 1f006000.watchdog is a symlink to a directory which contains these:
# ls -l
total 0
lrwxrwxrwx 1 root root 0 Nov 16 20:23 driver -> ../../../../bus/platform/drivers/infinity-wdt
-rw-r--r-- 1 root root 4096 Nov 16 20:23 driver_override
-r--r--r-- 1 root root 4096 Nov 16 20:23 modalias
lrwxrwxrwx 1 root root 0 Nov 16 20:23 of_node -> ../../../../firmware/devicetree/base/soc/watchdog
lrwxrwxrwx 1 root root 0 Nov 16 20:23 subsystem -> ../../../../bus/platform
-rw-r--r-- 1 root root 4096 Nov 16 20:23 uevent
This is the kernel log:
# cat /var/log/messages | grep -i watchdog
Jan 1 04:00:02 kernel: [WatchDog]infinity_wdt_probe
Jan 1 04:00:02 kernel: [WatchDog]infinity_wdt_set_heartbeat
Jan 1 04:00:04 kernel: [WatchDog]infinity_wdt_start
Jan 1 04:00:04 kernel: [WatchDog] infinity_wdt_ping tmr_margin=a ^M
Jan 1 04:00:04 kernel: watchdog: watchdog0: watchdog did not stop!
Jan 1 04:00:04 kernel: [WatchDog] infinity_wdt_ping tmr_margin=a ^M
Jan 1 04:00:04 kernel: [WatchDog]infinity_wdt_set_timeout=60
Jan 1 04:00:04 kernel: [WatchDog]infinity_wdt_set_timeout data=3c ^M
Jan 1 04:00:04 kernel: [WatchDog] infinity_wdt_ping tmr_margin=3c ^M
Jan 1 04:00:04 kernel: [WatchDog] infinity_wdt_ping tmr_margin=3c ^M
Nov 16 21:03:11 kernel: [WatchDog] infinity_wdt_ping tmr_margin=3c ^M
Nov 16 21:03:41 kernel: [WatchDog] infinity_wdt_ping tmr_margin=3c ^M
"Platform" driver means driver that doesn't fit into other standard subsystem (e.g. USB, I2C, etc). In this case it's a watchdog driver, which is apparently supposed to reboot embedded system if it's not responsive.
Entries in sysfs are standard bookkeeping entries, automatically created for any driver by kernel.
Since driver contains "of_match_table", it implies that it must be correctly specified in the device tree. Given it generally works and has no other explicit interfaces (e.g. procfs, sysfs), this should be enough to enable it.
You might also check if corresponding /dev/watchdog* is created by this driver. If so, standard userspace watchdog can be used by specified this /dev/watchdog* file in its config file.

Relocations in generic ELF (EM: 62) while cross-compiling from linux to openwrt

Trying to execute "make". I have checked the toolchain directory, which is fine as I have tried successfully compiled some other files. Want to know the reason behind this error, and where to check for solution.
-rwxrw-rw- 1 ayaz ayaz 7246 Dec 17 23:33 csi_fun.c
-rwxrw-rw- 1 ayaz ayaz 2133 Dec 17 23:33 csi_fun.h
-rwxrw-rw- 1 ayaz ayaz 4488 Dec 17 23:33 csi_fun.o
-rwxrw-rw- 1 ayaz ayaz 3881 Dec 17 23:33 main.c
-rwxrw-rw- 1 ayaz ayaz 4024 Dec 17 23:33 main.o
-rwxrw-rw- 1 ayaz ayaz 399 Dec 22 15:46 Makefile
-rwxrw-rw- 1 ayaz ayaz 13580 Dec 17 23:33 recv_csi
ayaz#ubuntu:~/Atheros_CSI_tool_OpenWRT_UserSpaceApp_src-master/recvCSI$ make
mips-openwrt-linux-gcc csi_fun.o main.o -o recvCSI
/home/ayaz/openwrt/staging_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.16/lib/gcc/mips-openwrt-linux-musl/5.3.0/../../../../mips-openwrt-linux-musl/bin/ld: csi_fun.o: Relocations in generic ELF (EM: 62)
/home/ayaz/openwrt/staging_dir/toolchain-mips_34kc_gcc-5.3.0_musl-1.1.16/lib/gcc/mips-openwrt-linux-musl/5.3.0/../../../../mips-openwrt-linux-musl/bin/ld: csi_fun.o: Relocations in generic ELF (EM: 62)
csi_fun.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
make: *** [recvCSI] Error 1
SOLVED after re-installing the toolchain directiry
If you compiled an object for your host system instead of your target system (i.e forgot to specify ARCH or CROSS_COMPILER) you will need to delete those objects. make clean or make distclean usually does the trick.

How to check if a locale is UTF-8?

I'm working with Yocto to create an embedded linux distribution for an ARM device (i.MX 6Quad Processors).
I've configured the list of desired locales with the variable:
IMAGE_LINGUAS = "de-de fr-fr en-gb en-gb.iso-8859-1 en-us en-us.iso-8859-1 zh-cn"
As result I've obtained a file systems that contains the following folders:
root#lam_icu:/usr/lib/locale# cd /usr/share/locale/
root#lam_icu:/usr/share/locale# ls -la
total 0
drwxr-xr-x 6 root root 416 Nov 17 2016 .
drwxr-xr-x 30 root root 2056 Nov 17 2016 ..
drwxr-xr-x 4 root root 296 Nov 17 2016 de
drwxr-xr-x 3 root root 232 Nov 17 2016 en_GB
drwxr-xr-x 4 root root 296 Nov 17 2016 fr
drwxr-xr-x 4 root root 296 Nov 17 2016 zh_CN
and:
root#lam_icu:/usr/share/locale# cd /usr/lib/locale/
root#lam_icu:/usr/lib/locale# ls -la
total 0
drwxr-xr-x 9 root root 640 Mar 13 2017 .
drwxr-xr-x 32 root root 40000 Mar 13 2017 ..
drwxr-xr-x 3 root root 1016 Mar 13 2017 de_DE
drwxr-xr-x 3 root root 1016 Mar 13 2017 en_GB
drwxr-xr-x 3 root root 1016 Mar 13 2017 en_GB.ISO-8859-1
drwxr-xr-x 3 root root 1016 Mar 13 2017 en_US
drwxr-xr-x 3 root root 1016 Mar 13 2017 en_US.ISO-8859-1
drwxr-xr-x 3 root root 1016 Mar 13 2017 fr_FR
drwxr-xr-x 3 root root 1016 Mar 13 2017 zh_CN
Which is the encoding of all non ISO-8859-1 locales? Can I assume that "en_GB" or "en_US" use the UTF-8 encoding?
I've tried to open the "LC_IDENTIFICATION" file, the result is:
Hc�������������cEnglish locale for the USAFree Software
Foundation,
Inc.http://www.gnu.org/software/libc/bug-glibc-locales#gnu.orgEnglishUSA1.02000-06-24en_US:2000en_US:2000en_US:2000en_US:2000en_US:2000en_US:2000en_US:2000en_US:2000en_US:2000en_US:2000en_US:2000en_US:2000UTF-8
At the end of the file there is something that recalls "UTF-8". Is this enough to assume that the encoding is UTF-8?
How to check if a locale is UTF-8?
LC_IDENTIFICATION doesn't tell you much:
LC_IDENTIFICATION - this is not a user-visible category, it contains information about the locale itself and is rarely useful for users or developers (but is listed here for completeness sake).
You'd have to look at the complete set of files.
There appears to be no standard command-line utility for doing this, but there is a runtime call (added a little later than the original locale functions). Here is a sample program which illustrates the function nl_langinfo:
#include <stdio.h>
#include <locale.h>
#include <langinfo.h>
int
main(int argc, char **argv)
{
int n;
for (n = 1; n < argc; ++n) {
if (setlocale(LC_ALL, argv[n]) != 0) {
char *code = nl_langinfo(CODESET);
if (code != 0)
printf("%s ->%s\n", argv[n], code);
else
printf("?%s (nl_langinfo)\n", argv[n]);
} else {
printf("? %s (setlocale)\n", argv[n]);
}
}
return 0;
}
and some output, e.g., by foo $(locale -a):
aa_DJ ->ISO-8859-1
aa_DJ.iso88591 ->ISO-8859-1
aa_DJ.utf8 ->UTF-8
aa_ER ->UTF-8
aa_ER#saaho ->UTF-8
aa_ER.utf8 ->UTF-8
aa_ER.utf8#saaho ->UTF-8
aa_ET ->UTF-8
aa_ET.utf8 ->UTF-8
af_ZA ->ISO-8859-1
af_ZA.iso88591 ->ISO-8859-1
af_ZA.utf8 ->UTF-8
am_ET ->UTF-8
am_ET.utf8 ->UTF-8
an_ES ->ISO-8859-15
an_ES.iso885915 ->ISO-8859-15
an_ES.utf8 ->UTF-8
ar_AE ->ISO-8859-6
ar_AE.iso88596 ->ISO-8859-6
ar_AE.utf8 ->UTF-8
ar_BH ->ISO-8859-6
ar_BH.iso88596 ->ISO-8859-6
The directory names you're referring to are often (but not required) to be the same as encoding names. That is the assumption made in the example program. There was a related question in How to get terminal's Character Encoding, but it has no useful answers. One is interesting though, since it asserts that
locale charmap
will give the locale encoding. According to the standard, that's not necessarily so:
The command locale charmap gives the name used in localedef -f
However, localedef attaches no special meaning to the name given in the -f option.
localedef has a different option -u which identifies the codeset, but locale (in the standard) mentions no method for displaying this information.
As usual, implementations may (or may not) treat unspecified features in different ways. The GNU C library's documentation differs in some respects from the standard (see locale and localedef), but offers no explicit options for showing the codeset name.

OCaml error: Unbound module Event

I try to build a short ocaml event example. But when I compile, the error in the title appears.
The question of: unbound module Event error when compiling Ocaml game was not helpful for me.
The system is Kubuntu 14.04 and I installed ocaml over aptitude, so installed packages are:
camlp4, ledit, libfindlib-ocaml, libfindlib-ocaml-dev, liboasis-ocaml, liboasis-ocaml-dev, libodn-ocaml, libodn-ocaml-dev, libtype-conv-camlp4-dev, oasis, ocaml, ocaml-base, ocaml-base-nox, ocaml-compiler-libs, ocaml-doc, ocaml-findlib, ocaml-interp, ocaml-native-compilers, ocaml-nox
The OCaml compiler is version 4.01.0
Here is my short test program.
open Thread;;
open Event;;
let chan = Event.new_channel();;
let a () =
Printf.printf "A waiting...\n";;
let sigRX = Event.receive chan in
Printf.printf "A received over channel\n";
let v = Event.sync sigRx in
Printf.printf "A running\n";
Printf.printf "A done!\n";;
let b () =
Thread.delay 0.8
Printf.printf "B sending...\n";;
let sigTX = Event.send "wake up" in
Event.sync sigTX;
Printf.printf "B done!\n";;
let t_a = Thread.create a ();;
let t_b = Thread.create b ();;
I tried to compile this single file (test.ml) with:
ocamlc -thread unix.cma threads.cma test.ml
The response is:
File "test.ml", line 2, characters 0-10:
Error: Unbound module Event
I googled, found some "thread-using-tips" like: http://caml.inria.fr/pub/docs/manual-ocaml/libthreads.html#c%3Athreads
In /usr/lib/ocaml is an threads folder and an thread.mli. Inside the threads folder there are this files:
-rw-r--r-- 1 root root 487 Jan 2 2014 condition.cmi
-rw-r--r-- 1 root root 487 Jan 2 2014 condition.cmx
-rw-r--r-- 1 root root 1203 Jan 2 2014 event.cmi
-rw-r--r-- 1 root root 1867 Jan 2 2014 event.cmx
-rw-r--r-- 1 root root 421 Jan 2 2014 mutex.cmi
-rw-r--r-- 1 root root 407 Jan 2 2014 mutex.cmx
-rw-r--r-- 1 root root 1859 Jan 2 2014 thread.cmi
-rw-r--r-- 1 root root 1308 Jan 2 2014 thread.cmx
-rw-r--r-- 1 root root 62778 Jan 2 2014 threads.a
-rw-r--r-- 1 root root 47047 Jan 2 2014 threads.cma
-rw-r--r-- 1 root root 1258 Jan 2 2014 threads.cmxa
-rw-r--r-- 1 root root 4145 Jan 2 2014 threadUnix.cmi
-rw-r--r-- 1 root root 1515 Jan 2 2014 threadUnix.cmx
What am I missing? I assume, that the Event is packed in Thread Module?
This command line works for me to get past the unbound module problem.
$ ocamlc -I +threads -c test.ml
There are errors in your code, but I imagine you'll know how to fix them.
This full command line will probably work, but I can't be sure because of the errors:
$ ocamlc -thread -I +threads unix.cma threads.cma test.ml
(There are some higher-level tools for building OCaml programs that you might want to learn about at some point.)

gammu-smsd RunOnReceive script results exit status 2

I want to forward an SMS using gammu-smsd RunOnReceive.
That is the script I want to run (/var/spool/gammu/forward.sh) and it goes perfectly if I run it from a sudoer or using sudo -u gammu -g gammu /var/spool/gammu/forward.sh
#!/bin/bash
SMS_MESSAGES=1
for i in `seq $SMS_MESSAGES`
do
number="SMS_${i}_NUMBER"
text="SMS_${i}_TEXT"
eval "gammu-smsd-inject TEXT my_number_goes_here -text \"${!number}: ${!text}\""
done
And here is the problem I am experiencing:
Thu 2015/01/29 23:08:57 gammu-smsd[2549]: Starting run on receive: /var/spool/gammu/forward.sh IN20150130_000850_00_+37368214400_00.txt
Thu 2015/01/29 23:08:57 gammu-smsd[2154]: Process failed with exit status 2
Output of ls -l /etc/gammu-smsdrc /var/spool/gammu/ /usr/bin/gammu-smsd*:
-rw-r--r-- 1 root root 457 Jan 29 22:44 /etc/gammu-smsdrc
-rwxrwxrwx 1 root root 14336 Jun 10 2012 /usr/bin/gammu-smsd
-rwxrwxrwx 1 root root 51164 Jun 10 2012 /usr/bin/gammu-smsd-inject
-rwxrwxrwx 1 root root 9972 Jun 10 2012 /usr/bin/gammu-smsd-monitor
/var/spool/gammu/:
total 24
drwxrwxrwx 2 gammu gammu 4096 Jan 28 16:02 error
-rwxrwxrwx 1 gammu gammu 189 Jan 29 22:13 forward.sh
drwxrwxrwx 2 gammu gammu 4096 Jan 29 23:08 inbox
-rw-rw-r-- 1 gammu gammu 3702 Jan 29 23:08 log
drwxrwxrwx 2 gammu gammu 4096 Jan 29 23:07 outbox
drwxrwxrwx 2 gammu gammu 4096 Jan 29 23:07 sent
What happens if I just do ./forward.sh (not root) - so all is OK:
gammu-smsd-inject[2606]: Created outbox message OUTC20150029_231213_00_my_number_here_sms0.txt
Written message with ID /var/spool/gammu/outbox/OUTC20150029_231213_00_my_number_here_sms0.txt
Here is my /etc/gammu-smsdrc
# Configuration file for Gammu SMS Daemon
[gammu]
port = /dev/ttyUSB0
connection = at
[smsd]
service = files
logfile = /var/spool/gammu/log
debuglevel = 2
commtimeout = 1
sendtimeout = 15
statusfrequency = 0
outboxformat = unicode
transmitformat = unicode
RunOnReceive = /var/spool/gammu/forward.sh
inboxpath = /var/spool/gammu/inbox/
outboxpath = /var/spool/gammu/outbox/
sentsmspath = /var/spool/gammu/sent/
errorsmspath = /var/spool/gammu/error/
ps -fe | grep gammu:
gammu 2154 1 0 23:05 ? 00:00:02 /usr/bin/gammu-smsd --daemon --user gammu --pid /var/run/gammu-smsd.pid
cubie 2644 2403 0 23:20 pts/0 00:00:00 grep gammu
Please, help
I had the same problem and I solved it this way:
First add gammu user to sudoers, with no password:
type: $ sudo visudo
and add: gammu ALL=(ALL) NOPASSWD: ALL
Then run gammu-smsd as root user:
in /etc/init.d/gammu-smsd
change USER=gammu to USER=root
save it and don't forget to restart daemon: service gammu-smsd restart
In RunOnReceive script add sudo in front of gammu-smsd-inject:
e.g.: sudo gammu-smsd-inject TEXT my_tel_num -text "Hello world!"
I hope this will work for you too!
P.S.: I use Gammu version 1.31.90.

Resources