Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asterisk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Voice
asterisk
Commits
8aa4e1c3
Commit
8aa4e1c3
authored
5 years ago
by
Friendly Automation
Committed by
Gerrit Code Review
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Revert "app_voicemail: Cleanup stale lock files on module load""
parents
d5901a2d
7362647e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/app_voicemail.c
+0
-51
0 additions, 51 deletions
apps/app_voicemail.c
doc/CHANGES-staging/voicemail_lock_cleanup_revert.txt
+10
-0
10 additions, 0 deletions
doc/CHANGES-staging/voicemail_lock_cleanup_revert.txt
with
10 additions
and
51 deletions
apps/app_voicemail.c
+
0
−
51
View file @
8aa4e1c3
...
...
@@ -3745,54 +3745,6 @@ static void check_quota(struct vm_state *vms, char *mailbox) {
#endif /* IMAP_STORAGE */
static void cleanup_orphaned_lock_files(const char *base)
{
DIR *dir;
struct dirent *e;
dir = opendir(base);
if (!dir) {
/* Don't complain about this too loudly */
ast_debug(2, "Unable to open `%s': %s\n", base, strerror(errno));
return;
}
while ((e = readdir(dir))) {
char *fullpath;
struct stat s;
/* Always skip . and .. */
if (!strcmp(e->d_name, ".") || !strcmp(e->d_name, "..")) {
continue;
}
/* Build up the full path (using dynamic memory because PATH_MAX is crap) */
if (ast_asprintf(&fullpath, "%s/%s", base, e->d_name) == -1) {
break;
}
if (lstat(fullpath, &s) < 0) {
ast_free(fullpath);
continue;
}
/* This is exposing an implementation detail of ast_lock_path, but it makes
* our life a bit easier */
if (!strcmp(e->d_name, ".lock") && S_ISLNK(s.st_mode)) {
if (!ast_unlock_path(base)) {
ast_log(AST_LOG_NOTICE, "Cleaned up orphaned lock file: %s/.lock\n", base);
}
} else if (S_ISDIR(s.st_mode)) {
/* If it is a directory, let's dive down */
cleanup_orphaned_lock_files(fullpath);
}
ast_free(fullpath);
}
closedir(dir);
}
/*! \brief Lock file path
* only return failure if ast_lock_path returns 'timeout',
* not if the path does not exist or any other reason
...
...
@@ -15247,9 +15199,6 @@ static int load_module(void)
/* compute the location of the voicemail spool directory */
snprintf(VM_SPOOL_DIR, sizeof(VM_SPOOL_DIR), "%s/voicemail/", ast_config_AST_SPOOL_DIR);
/* Now that we have a spool directory, clean up old lock files */
cleanup_orphaned_lock_files(VM_SPOOL_DIR);
if (!(mwi_subscription_tps = ast_taskprocessor_get("app_voicemail", 0))) {
ast_log(AST_LOG_WARNING, "failed to reference mwi subscription taskprocessor. MWI will not work\n");
}
...
...
This diff is collapsed.
Click to expand it.
doc/CHANGES-staging/voicemail_lock_cleanup_revert.txt
0 → 100644
+
10
−
0
View file @
8aa4e1c3
Subject: app_voicemail
A feature was added in Asterisk 13.27.0 and 16.4.0 that removed lock files from
the Asterisk voicemail directory on startup. Some users that store their
voicemails on network storage devices experienced slow startup times due to the
relative expense of traversing the voicemail directory structure looking for
orphaned lock files. This feature has now been removed.
Users who require the lock files to be removed at startup should modify their
startup scripts to do so before starting the asterisk process.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment