~ubuntu-branches/ubuntu/trusty/rsyslog/trusty

« back to all changes in this revision

Viewing changes to runtime/apc.c

  • Committer: Dave Walker (Daviey)
  • Author(s): Scott Moser
  • Date: 2011-06-17 20:59:38 UTC
  • mfrom: (36.1.8 oneiric.merge)
  • Revision ID: davewalker@ubuntu.com-20110617205938-pfkizxz2wsgzi2ot
Tags: 5.8.1-1ubuntu1
* Resynchronise with Debian (LP: #794230).  Remaining changes:
  - Run as rsyslog:rsyslog, set $FileOwner to syslog
  - Replace init script with debian/rsyslog.upstart.
  - debian/rsyslog.logrotate: Use reload command to restart rsyslog
  - debian/rsyslog.conf: enable $RepeatedMsgReduction 
    to avoid bloating the syslog file (LP #453444)
  - Add debian/rsyslog.dmesg.upstart to save initial dmesg into a file.
    Install it in debian/rules.
  - debian/50-default.conf: set of default rules for syslog (forwarded to
    Debian #603160). remove file in postrm on purge. manage with ucf.
  - debian/rules: build with LDFLAGS=""
* Dropped:
  - debian/control: Bump build-dependency on debhelper
    debian now depends on dh >= 8
* New upstream release.
* Bump Standards-Version to 3.9.2. No further changes.
* Enable and install impstats module. (Closes: #620114)
* Update logcheck rule. (Closes: #616659)
* debian/rsyslog.init: Set correct compat level (5).
* The way rsyslog processes SIGHUP has changed. It no longer does a reload
  of its configuration, but simply closes all open files. To apply a changed
  configuration, rsyslogd needs to be restarted now.
  - Drop "reload" action from debian/rsyslog.init, map "force-reload" to
    "restart". (Closes: #580897)
  - Add "rotate" action to debian/rsyslog.init which sends SIGHUP to
    rsyslogd. Use that in debian/rsyslog.logrotate. (Closes: #626365)
  - Update debian/rsyslog-mysql.postinst and rsyslog-pgsql.postinst to use
    restart instead of reload.
  - Add a NEWS file explaining the changed SIGHUP handling.
* New upstream stable release.
* New upstream release.
  - Properly handle ANSI SQL strings in ompgsql. (Closes: #600479)
* New upstream release.
* debian/patches/02-pmaixforwardedfrom_type_nokeep.patch
  - Remove, merged upstream.
* debian/patches/03-epoll_create1-fallback.patch
  - Remove, merged upstream.
* debian/patches/03-epoll_create1-fallback.patch
  - If epoll_create1() is not available during runtime, fall back to
    epoll_create(). This fixes remote syslog when runnig rsyslog on a
    lenny kernel. (Closes: #617996)
* New upstream release.
* debian/rsyslog.links
  - Create symlink for rsyslog.service in multi-user.target.wants so rsyslog
    is enabled by default when using systemd.
* debian/patches/02-pmaixforwardedfrom_type_nokeep.patch
  - Fix build failure in aixforwardedfrom parser module by setting the
    module type to NOKEEP.
* debian/rsyslog.preinst
  - Remove old rsyslog.socket symlink from sockets.target.wants on upgrades
    as rsyslog uses syslog.socket now which is provided by systemd.
* debian/rsyslog.install
  - Stop installing rsyslog.socket.
* New upstream release.
* New upstream release.
  - Fix regression in imuxsock plugin which did no longer sanitize received
    messages. This makes 02-cleanup-trailing-lf.patch obsolete and also
    fixes the SQL syntax errors in the mysql output if the input contained
    NUL bytes. Closes: #614061
* Enable and install omprog output plugin. Closes: #552095
* Improve package description. Closes: #612948
  Thanks to Justin B Rye for the patch.
* debian/patches/02-cleanup-trailing-lf.patch
  - Fix regression in imuxsock plugin which did not remove a trailing LF
    anymore. Patch cherry-picked from upstream Git. Closes: #612829
* New upstream release.
* Enable and install parser modules.
* New upstream release.
* Upload to unstable.
* debian/patches/02-typo_fix_equation_sign.patch
  - Removed, merged upstream.
* debian/patches/03-atomic_operations.patch
  - Removed, merged upstream.
* debian/patches/03-atomic_operations.patch
  - Fix build failures on platforms which don't have 64 bit atomic
    operations. Patch cherry-picked from upstream Git. Closes: #600930
* New upstream development release.
* Remove patches, merged upstream
  - debian/patches/02-install_also_rsyslog_socket.patch
  - debian/patches/02-tls_loop_fix.patch
* debian/patches/02-typo_fix_equation_sign.patch
  - Fix small typo ("equation sign"). Closes: #575589
* debian/rsyslog.postinst
  - Remove pre-lenny migration code to rotate old log files from sysklogd.
* New upstream development release.
* debian/rsyslog.install
  - Install omruleset.so plugin: http://www.rsyslog.com/doc/omruleset.html
* debian/rsyslog.default
  - Start rsyslogd with native -c5 mode.
* Install systemd unit files which allow to run rsyslog in socket activation
  mode when systemd is used.
* debian/patches/02-install_also_rsyslog_socket.patch
  - When enabling rsyslog.service also enable rsyslog.socket. Patch
    cherry-picked from upstream Git.
* Bump debhelper compatibility level to 8. Update Build-Depends accordingly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
#include "obj.h"
41
41
#include "apc.h"
42
42
#include "srUtils.h"
 
43
#include "datetime.h"
43
44
 
44
45
/* static data */
45
46
DEFobjStaticHelpers
 
47
DEFobjCurrIf(datetime)
46
48
 
47
49
/* following is a used to implement a monotonically increasing id for the apcs. That
48
50
 * ID can be used to cancel an apc request. Note that the ID is generated with modulo
200
202
        DEFiRet;
201
203
        assert(ppList != NULL);
202
204
 
203
 
        time(&tCurr);
 
205
        datetime.GetTime(&tCurr);
204
206
 
205
207
        if(apcListRoot == NULL || apcListRoot->pApc->ttExec >  tCurr) {
206
208
                *ppList = NULL;
249
251
        apc_list_t *pExecList;
250
252
        apc_list_t *pCurr;
251
253
        apc_list_t *pNext;
252
 
        DEFVARS_mutexProtection_uncond;
253
254
        DEFiRet;
254
255
 
255
 
        BEGIN_MTX_PROTECTED_OPERATIONS_UNCOND(&listMutex);
 
256
        d_pthread_mutex_lock(&listMutex);
256
257
        iRet = unlistCurrent(&pExecList);
257
 
        END_MTX_PROTECTED_OPERATIONS_UNCOND(&listMutex);
 
258
        d_pthread_mutex_unlock(&listMutex);
258
259
        CHKiRet(iRet);
259
260
 
260
261
        if(pExecList != NULL) {
290
291
static rsRetVal
291
292
apcConstructFinalize(apc_t *pThis, apc_id_t *pID)
292
293
{
293
 
        DEFVARS_mutexProtection_uncond;
294
294
        DEFiRet;
295
295
        ISOBJ_TYPE_assert(pThis, apc);
296
296
        assert(pID != NULL);
297
 
        BEGIN_MTX_PROTECTED_OPERATIONS_UNCOND(&listMutex);
 
297
        d_pthread_mutex_lock(&listMutex);
298
298
        insertApc(pThis, pID);
299
 
        END_MTX_PROTECTED_OPERATIONS_UNCOND(&listMutex);
300
 
RUNLOG_STR("apcConstructFinalize post mutex unlock\n");
 
299
        d_pthread_mutex_unlock(&listMutex);
301
300
        RETiRet;
302
301
}
303
302
 
333
332
static rsRetVal
334
333
CancelApc(apc_id_t id)
335
334
{
336
 
        DEFVARS_mutexProtection_uncond;
337
 
 
338
335
        BEGINfunc
339
 
        BEGIN_MTX_PROTECTED_OPERATIONS_UNCOND(&listMutex);
 
336
        d_pthread_mutex_lock(&listMutex);
340
337
        deleteApc(id);
341
 
        END_MTX_PROTECTED_OPERATIONS_UNCOND(&listMutex);
 
338
        d_pthread_mutex_unlock(&listMutex);
342
339
        ENDfunc
343
340
        return RS_RET_OK;
344
341
}
380
377
 * rgerhards, 2009-04-06
381
378
 */
382
379
BEGINObjClassExit(apc, OBJ_IS_CORE_MODULE) /* class, version */
383
 
        //objRelease(apcstk, CORE_COMPONENT);
 
380
        objRelease(datetime, CORE_COMPONENT);
384
381
        pthread_mutex_destroy(&listMutex);
385
382
ENDObjClassExit(apc)
386
383
 
391
388
 */
392
389
BEGINObjClassInit(apc, 1, OBJ_IS_CORE_MODULE) /* class, version */
393
390
        /* request objects we use */
394
 
        //CHKiRet(objUse(apcstk, CORE_COMPONENT));
 
391
        CHKiRet(objUse(datetime, CORE_COMPONENT));
395
392
 
396
393
        /* set our own handlers */
397
394
        OBJSetMethodHandler(objMethod_DEBUGPRINT, apcDebugPrint);